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