From 0677909df5d229f87ec8e32256a389a0a9552d1b Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 9 May 2024 14:16:47 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/svc/order/svc_order_list.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/admin/svc/order/svc_order_list.go b/app/admin/svc/order/svc_order_list.go index beb9b7e..d4799a5 100644 --- a/app/admin/svc/order/svc_order_list.go +++ b/app/admin/svc/order/svc_order_list.go @@ -725,21 +725,21 @@ func OrderEditNum(c *gin.Context) { return } num = orderGoods.Num - utils.StrToInt(args["num"]) - all.WaitBakingNum -= orderGoods.Num + all.WaitMakeNum -= orderGoods.Num order.Amount = utils.Float64ToStr(utils.StrToFloat64(order.Amount) - float64(num)*utils.StrToFloat64(orderGoods.Price)) //销量扣除 sqlSecond := `UPDATE goods SET sale=sale-%d WHERE id=%d` sqlSecond = fmt.Sprintf(sqlSecond, num, orderGoods.GoodsId) db.QueryNativeStringSess(sess, sqlSecond) } else { - all.WaitBakingNum += orderGoods.Num + all.WaitMakeNum += orderGoods.Num order.Amount = utils.Float64ToStr(utils.StrToFloat64(order.Amount) + float64(num)*utils.StrToFloat64(orderGoods.Price)) //销量增加 sqlSecond := `UPDATE goods SET sale=sale+%d WHERE id=%d` sqlSecond = fmt.Sprintf(sqlSecond, num, orderGoods.GoodsId) db.QueryNativeStringSess(sess, sqlSecond) } - _, err := sess.Where("id=?", all.Id).Cols("wait_baking_num").Update(all) + _, err := sess.Where("id=?", all.Id).Cols("wait_make_num").Update(all) if err != nil { sess.Rollback() e.OutErr(c, 400, e.NewErr(400, "修改失败"))