From 5110bc3659a5d039c99fa8fc7471add276008e04 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 9 Jul 2024 10:04:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/svc/order/svc_order_list.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/admin/svc/order/svc_order_list.go b/app/admin/svc/order/svc_order_list.go index 1e6b5df..90e7eb1 100644 --- a/app/admin/svc/order/svc_order_list.go +++ b/app/admin/svc/order/svc_order_list.go @@ -802,11 +802,19 @@ func OrderUpdateState(c *gin.Context) { for _, v1 := range flow { v1.SuccessNum += v.Num v1.WaitSortingNum -= v.Num + v1.WaitBakingNum -= v.Num + v1.WaitMakeNum -= v.Num if v1.WaitSortingNum < 0 { v1.WaitSortingNum = 0 } + if v1.WaitMakeNum < 0 { + v1.WaitMakeNum = 0 + } + if v1.WaitBakingNum < 0 { + v1.WaitBakingNum = 0 + } sess5 := sess - _, err = sess5.Where("id=?", v1.Id).Cols("success_num,wait_sorting_num").Update(&v1) + _, err = sess5.Where("id=?", v1.Id).AllCols().Update(&v1) if err != nil { sess.Rollback() e.OutErr(c, 400, e.NewErr(400, "操作失败"))