feat 减小更新库存时的粒度
Some checks failed
Build image / build (push) Failing after 18s

This commit is contained in:
timerzz 2024-04-13 09:21:08 +08:00
parent 7511492330
commit 1f51aeb783

View File

@ -126,7 +126,12 @@ func (c *CoachOutlet) Watch() {
}
}
if err = c.db.Save(c.detail).Error; err != nil {
if err = c.db.Where("uid = ?", c.Uid()).Updates(
map[string]interface{}{
"orderable": c.detail.Orderable,
"allocation_reset_date": c.detail.AllocationResetDate,
"watch": c.detail.Watch,
}).Error; err != nil {
slog.Error(fmt.Sprintf("更新数据库失败:%v", err))
}
// 如果可以预定了,那么退出