增加品牌

This commit is contained in:
qiyunfanbo126.com 2024-10-17 23:18:40 +08:00
parent 7120d29130
commit db08f1d96d
1 changed files with 4 additions and 0 deletions

View File

@ -53,16 +53,19 @@ func OrderQuery(c *gin.Context) {
var OrderQueryResponse front.OrderQueryResponse var OrderQueryResponse front.OrderQueryResponse
has, err := services.OrderDetailService(&order) has, err := services.OrderDetailService(&order)
if err != nil { if err != nil {
utils.Log(nil, "err", err)
controllers.Error(c, 500, "订单查询失败") controllers.Error(c, 500, "订单查询失败")
return return
} }
if has { if has {
if order.State < common.ORDER_STATUS_PAY && order.VoucherLink == "" { if order.State < common.ORDER_STATUS_PAY && order.VoucherLink == "" {
_, rsp := services.YouChuOrderQuery(order.Orders) _, rsp := services.YouChuOrderQuery(order.Orders)
utils.Log(nil, "三方订单查询", rsp) utils.Log(nil, "三方订单查询", rsp)
if rsp.OrderSta == "03" { if rsp.OrderSta == "03" {
err := services.OrdersUpdateService(front.OrdersUpdateRequest{Id: order.Id, Status: common.ORDER_STATUS_PAY, OrgTxnSeq: rsp.OrderNo}) err := services.OrdersUpdateService(front.OrdersUpdateRequest{Id: order.Id, Status: common.ORDER_STATUS_PAY, OrgTxnSeq: rsp.OrderNo})
if err != nil { if err != nil {
utils.Log(nil, "err", err)
controllers.Error(c, 500, "订单更新失败") controllers.Error(c, 500, "订单更新失败")
return return
} }
@ -73,6 +76,7 @@ func OrderQuery(c *gin.Context) {
OrderQueryResponse.MainImage = services.GetProductImage(order.ProductId) OrderQueryResponse.MainImage = services.GetProductImage(order.ProductId)
controllers.Success(c, OrderQueryResponse, "请求成功") controllers.Success(c, OrderQueryResponse, "请求成功")
} else { } else {
utils.Log(nil, "err", err)
controllers.HandCodeRes(c, nil, errorcode.NotFound) controllers.HandCodeRes(c, nil, errorcode.NotFound)
return return
} }