Browse Source

update

tmp
DengBiao 9 months ago
parent
commit
3b75a2472b
1 changed files with 14 additions and 3 deletions
  1. +14
    -3
      app/admin/hdl/hdl_notice.go

+ 14
- 3
app/admin/hdl/hdl_notice.go View File

@@ -98,9 +98,21 @@ func NoticeIsPopToCentralKitchen(c *gin.Context) {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
now := time.Now()

if popToCentralKitchen != nil && utils.StrToInt(id) != popToCentralKitchen.Id {
e.OutErr(c, e.ERR_NO_DATA, "当前已有弹出至央厨公告!")
return
notice, err1 := noticeDb.GetNotice(utils.StrToInt(id))
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1.Error())
return
}
notice.IsPopToCentralKitchen = 0
notice.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err = noticeDb.NoticeUpdate(notice, "is_pop_to_central_kitchen", "update_at")
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
}

notice, err := noticeDb.GetNotice(utils.StrToInt(id))
@@ -112,7 +124,6 @@ func NoticeIsPopToCentralKitchen(c *gin.Context) {
e.OutErr(c, e.ERR_NO_DATA, "未查询到对应记录")
return
}
now := time.Now()
notice.IsPopToCentralKitchen = utils.StrToInt(isPopToCentralKitchen)
notice.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err = noticeDb.NoticeUpdate(notice, "is_pop_to_central_kitchen", "update_at")


Loading…
Cancel
Save