🐛 fix bug
This commit is contained in:
@@ -44,7 +44,11 @@ func (w *wine) Update(p entity.Wine) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (w *wine) Delete(p entity.Wine) (err error) {
|
||||
err = client.MySQL.Delete(&p).Error
|
||||
func (w *wine) Delete(p *entity.Wine, ue *entity.User) (err error) {
|
||||
err = client.MySQL.Table(p.TableName()).Where("wine_id = ? and user_id = ?", p.WineId, ue.Id).Delete(&p).Error
|
||||
if err != nil {
|
||||
log.Errorf("删除酒单失败:%s", err.Error())
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user