From 0463cc625cfcd458f78333d7b980fa591d7a5669 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 29 Jan 2024 15:17:23 +0800 Subject: [PATCH] update --- app/admin/hdl/hdl_notice.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/admin/hdl/hdl_notice.go b/app/admin/hdl/hdl_notice.go index d738857..f672ff8 100644 --- a/app/admin/hdl/hdl_notice.go +++ b/app/admin/hdl/hdl_notice.go @@ -101,14 +101,9 @@ func NoticeIsPopToCentralKitchen(c *gin.Context) { now := time.Now() if popToCentralKitchen != nil && utils.StrToInt(id) != popToCentralKitchen.Id { - 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") + popToCentralKitchen.IsPopToCentralKitchen = 0 + popToCentralKitchen.UpdateAt = now.Format("2006-01-02 15:04:05") + _, err = noticeDb.NoticeUpdate(popToCentralKitchen, "is_pop_to_central_kitchen", "update_at") if err != nil { e.OutErr(c, e.ERR_DB_ORM, err.Error()) return