fix: thirdskuid

master
howell 4 years ago
parent 9b97d133b8
commit 4d9bf4c530

@ -1,7 +1,6 @@
package order_preview
import (
"git.oa00.com/go/mysql"
"math"
"recook/internal/back"
"recook/internal/dbc"
@ -16,6 +15,7 @@ import (
"recook/internal/v2/model/flashsale"
goods3 "recook/internal/v2/model/recook/goods"
"recook/tools"
"strconv"
"time"
"github.com/gin-gonic/gin"
@ -174,14 +174,14 @@ func CreatePreviewNormalOrder(c *gin.Context) {
return
}
}
var sku goods3.RecookGoodsSkuModel
mysql.Db.First(&sku, "goods_id = ?", goodsInfo.ID)
//var sku goods3.RecookGoodsSkuModel
//mysql.Db.First(&sku, "goods_id = ?", goodsInfo.ID)
id, _ := strconv.Atoi(sku.ThirdPartySkuId)
req1 := jcook.LogisticsFeeReq{
Address: p.Address,
SkuList: []jcook.LogisticsInfo{
{
goodsInfo.ThirdPartyId,
uint(id),
p.Quantity,
sku.PurchasePrice,
},
@ -424,7 +424,7 @@ func computeExpressFeeWithGoods(quantity uint, goodsInfo *goods.Information, pro
// baseWeight := (goodsInfo.Weight.Sub(freightPrice.FirstWeight)).Div(freightPrice.AdditionalWeight).Ceil() // 向上取整 意思是不满一斤算一斤
// expressFee = freightPrice.FirstWeightFee.Sub(baseWeight.Mul(freightPrice.AdditionalWeightFee))
//}
} else { // 按照重量计算
} else { // 按照重量计算
if goodsInfo.Weight.LessThanOrEqual(freightPrice.FirstWeight) { // 小于首重
expressFee = freightPrice.FirstWeightFee
} else {

Loading…
Cancel
Save