From 196447c10807322301e31d0fc6c3b991f25e8766 Mon Sep 17 00:00:00 2001 From: "qiyunfanbo126.com" <815699> Date: Wed, 4 Sep 2024 16:17:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95=E8=BD=AE?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/OrderService.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/OrderService.go b/app/services/OrderService.go index 87efd4f..fc59c35 100644 --- a/app/services/OrderService.go +++ b/app/services/OrderService.go @@ -105,7 +105,7 @@ func OrderQueryService(userId int, OrderRequest *front.OrderListRequest) (code i conn = conn.And(builder.Eq{"a.state": OrderRequest.State}) } count, err := repo.Where(conn).Alias("a"). - Join("INNER", "Products b", "a.product_id = b.id").Select("a.*,b.main_image"). + Join("INNER", "products b", "a.product_id = b.id").Select("a.*,b.main_image"). Desc("id").Limit(OrderRequest.PageSize, (OrderRequest.Page-1)*OrderRequest.PageSize).FindAndCount(&data) code = handErr(err) return @@ -181,7 +181,7 @@ func OrderRefundService(userId int, orderId int) (code int) { _, err := ordersmodel.GetInstance().GetDb().Where("id = ?", order.Id).Update(order) //增加库存 if err == nil { - _, err = ordersmodel.GetInstance().GetDb().Exec("update Products set stock=stock+1 where id = " + strconv.Itoa(order.ProductId)) + _, err = ordersmodel.GetInstance().GetDb().Exec("update products set stock=stock+1 where id = " + strconv.Itoa(order.ProductId)) return errorcode.Success } else { return errorcode.OrderRefundUpdateFail