diff --git a/app/services/OrderService.go b/app/services/OrderService.go index d58c56e..3b27bc0 100644 --- a/app/services/OrderService.go +++ b/app/services/OrderService.go @@ -180,7 +180,7 @@ func OrderRefundService(userId int, orderId int) (code int) { order.RefundOrderNo = response.RefundOrderNo order.RefundOrderSta = response.RefundOrderSta order.RefundTime = time.Now() - _, err := ordersmodel.GetInstance().GetDb().Where("id = ?", order.Id).Update(order) + _, err := ordersmodel.GetInstance().GetDb().Where("id = ?", order.Id).Update(order.Orders) //增加库存 if err == nil { _, err = ordersmodel.GetInstance().GetDb().Exec("update products set stock=stock+1 where id = " + strconv.Itoa(order.ProductId))