fix 修复刚添加的pusher没有推送的bug

This commit is contained in:
timerzz 2024-04-10 20:06:33 +08:00
parent d09465645b
commit c19da13793
2 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ func (c *Controller) AddPusher(opt *model.Pusher[options.AnPushOption]) error {
if err := tx.Create(opt).Error; err != nil {
return err
}
fmt.Println("id", opt.ID)
c.m[opt.ID] = NewAnPush(&opt.Option)
return nil
})
}

View File

@ -73,7 +73,7 @@ func (c *Controller) RunWatcher(opt *options.CoachOutletOption) error {
uid := opt.Uid()
err := c.db.Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "uid"}},
DoUpdates: clause.AssignmentColumns([]string{"watch", "remark", "orderable", "pusher_ids"}),
DoUpdates: clause.AssignmentColumns([]string{"watch", "remark", "orderable", "pusher_ids", "deleted_at"}),
}).Create(&model.Product{Uid: uid, Watch: true, Remark: opt.Remark, Orderable: false, PusherIds: opt.PusherIds}).Error
if err != nil {