|
|
@@ -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") |
|
|
|