1
This commit is contained in:
@@ -175,16 +175,12 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr
|
||||
// 获取门店品牌余额
|
||||
storeAcct, err := cms.GetStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order)) // 获取门店余额
|
||||
// 如果门店没钱,查看品牌,查询门店品牌id
|
||||
storeList, err := dao.GetStoreList(dao.GetDB(), []int{jxutils.GetSaleStoreIDFromOrder(order)}, nil, nil, nil, nil, "")
|
||||
if err != nil || len(storeList) != 1 {
|
||||
return nil, fmt.Errorf("门店id:[%d],所属品牌不唯一,或其他查询错误", order.JxStoreID)
|
||||
}
|
||||
result, err := partner.CurStoreAcctManager.GetBrandBalance(storeList[0].BrandID) // 品牌余额
|
||||
result, err := partner.CurStoreAcctManager.GetBrandBalance(storeDetail.BrandID) // 品牌余额
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var balance int
|
||||
if storeList[0].BrandID == scheduler.JXC4B_SHOP || storeList[0].BrandID == scheduler.JXC4B_RAND_JXGY { // 京西品牌,扣门店
|
||||
if storeDetail.BrandID == scheduler.JXC4B_SHOP || storeDetail.BrandID == scheduler.JXC4B_RAND_JXGY { // 京西品牌,扣门店
|
||||
balance = storeAcct.AccountBalance
|
||||
} else {
|
||||
if storeAcct.AccountBalance >= model.BrandBalanceLimit {
|
||||
@@ -192,9 +188,11 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr
|
||||
} else if storeAcct.AccountBalance < model.BrandBalanceLimit && result >= model.BrandBalanceLimit {
|
||||
balance = result
|
||||
} else {
|
||||
balance = result
|
||||
balance = 0
|
||||
}
|
||||
}
|
||||
fmt.Println("1111111111111111111111",storeAcct)
|
||||
fmt.Println("1111111111111111111111",result)
|
||||
fmt.Println("1111111111111111111111",balance)
|
||||
//balance, _ = partner.CurStoreAcctManager.GetBrandBalance(storeDetail.BrandID)
|
||||
handlerInfo := partner.GetDeliveryPlatformFromVendorID(platformVendorID)
|
||||
|
||||
Reference in New Issue
Block a user