添加处理

master
kanade 3 years ago
parent 91ab54049b
commit 6e0997a247

@ -155,7 +155,7 @@ func getStatus(orderInfo order.Information, goodsDetail order.GoodsDetail) strin
txt = "退款成功"
}
if goodsDetail.IsClosed == 1 {
txt = "退货退款关闭"
txt = "退款关闭"
}
} else if goodsDetail.AssType == 2 { //售后完结

@ -3,6 +3,8 @@ package order_preview
import (
"errors"
"fmt"
"git.oa00.com/go/mysql"
"log"
"math"
"recook/configs"
"recook/internal/back"
@ -16,6 +18,7 @@ import (
"recook/internal/v2/lib/jcook"
"recook/internal/v2/lib/shama"
"recook/internal/v2/model/flashsale"
goods2 "recook/internal/v2/model/recook/goods"
"recook/tools"
"strconv"
"time"
@ -219,6 +222,29 @@ func CreatePreviewNormalOrder(c *gin.Context) {
}
var resp2 jcook.LogisticsFeeResp
if err := client.Exec(req1, &resp2); err != nil {
if err.Error() == "商品价格不匹配" {
go func() {
rq := jcook.SkuPriceReq{
SkuIDSet: []uint{uint(id)},
}
var res []jcook.SkuPriceResp
if err := client.Exec(rq, &res); err != nil {
return
}
if len(res) == 0 {
return
}
t := res[0]
var sku goods2.RecookGoodsSkuModel
if err := mysql.Db.Table(sku.TableName()).Where("third_party_sku_id = ? and third_party_type=3", t.SkuID).Updates(map[string]interface{}{
"purchase_price": t.SupplyPrice,
}).Error; err != nil {
log.Println(err.Error())
return
}
}()
}
back.Err(c, err.Error())
return
}

Loading…
Cancel
Save