fix: 完成商务迁移复核与接口优化并清理历史资料

This commit is contained in:
Yvan
2026-11-04 14:45:02 +08:00
parent 5a96be6a79
commit 297e80827d
176 changed files with 6803 additions and 6002 deletions
+3 -1
View File
@@ -75,7 +75,9 @@ func (r *channelWriteRepo) Create(ctx context.Context, input *business.ChannelWr
conn.WithContext(cleanup).Exec("DO RELEASE_LOCK(?)", lockName)
}()
}
return conn.Transaction(func(tx *gorm.DB) error {
// GET_LOCK 的标量 Scan 会修改固定连接上的 Statement.Model。
// 清空查询状态后再开事务,仍复用持锁连接,避免后续结构体 Take 读取到标量模型。
return conn.Session(&gorm.Session{NewDB: true}).Transaction(func(tx *gorm.DB) error {
var count int64
if err := tx.Model(&platformChannelPO{}).Where("account = ?", input.Account).Count(&count).Error; err != nil {
return err