1
This commit is contained in:
@@ -1753,6 +1753,12 @@ func GetMatterStoreOrderCount(ctx *jxcontext.Context, storeID int) (result *Orde
|
||||
return nil, err
|
||||
}
|
||||
orderCount.Count = int(utils.Float64TwoInt64(math.Ceil(utils.Int2Float64(orderCount.Count) * 1.1)))
|
||||
if orderCount.Count <= 0 {
|
||||
stores, _ := dao.GetStoreList(db, []int{storeID}, nil, nil, nil, nil, "")
|
||||
if len(stores) > 0 && time.Since(stores[0].CreatedAt) > 7*24*time.Hour {
|
||||
flag = false
|
||||
}
|
||||
}
|
||||
orderCount.Flag = flag
|
||||
// orderCount.Count = 1000
|
||||
return orderCount, err
|
||||
|
||||
@@ -817,9 +817,6 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
|
||||
result, _ = orderman.GetMatterStoreOrderCount(nil, fromStoreID)
|
||||
sum = result.Count
|
||||
}
|
||||
if sum <= 0 {
|
||||
return nil, nil, fmt.Errorf("没有足够的订单兑换物料")
|
||||
}
|
||||
if jxOrder.Weight == 0 {
|
||||
for _, v := range jxOrder.Skus {
|
||||
v.Weight = storeSkuMap[v.SkuID].Weight
|
||||
@@ -874,7 +871,7 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
|
||||
if jxOrder.OrderType != model.OrderTypeMatter || (jxOrder.OrderType == model.OrderTypeMatter && fromStoreID == -1) {
|
||||
outJxOrder.Skus = append(outJxOrder.Skus, jxSku)
|
||||
outJxOrder.OrderPrice += int64(jxSku.Count) * jxSku.SalePrice
|
||||
} else { //以下else为物料订单袋子金额和数量处理
|
||||
} else { //以下else为物料订单袋子金额和数量处理
|
||||
if !result.Flag { //只要flag是false就按原价申请,是true再按订单量
|
||||
outJxOrder.Skus = append(outJxOrder.Skus, jxSku)
|
||||
outJxOrder.OrderPrice += int64(jxSku.Count) * jxSku.SalePrice
|
||||
|
||||
Reference in New Issue
Block a user