|
@@ -5,6 +5,7 @@ import ( |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/lib/comm_plan" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/lib/comm_plan" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/md" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/md" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/svc" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/svc" |
|
|
|
|
|
zhios_order_relate_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils" |
|
|
"context" |
|
|
"context" |
|
|
"errors" |
|
|
"errors" |
|
|
"golang.org/x/sync/errgroup" |
|
|
"golang.org/x/sync/errgroup" |
|
@@ -119,3 +120,30 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar |
|
|
|
|
|
|
|
|
return goodsId2lvUser, nil |
|
|
return goodsId2lvUser, nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//商品详情等使用 |
|
|
|
|
|
func SettleCommWithGoodsDetail(eg *xorm.Engine, dbName string, CommissionParam md.CommissionFirstParam) (float64, float64, float64, float64, *comm_plan.LvUser, error) { |
|
|
|
|
|
var ( |
|
|
|
|
|
isShare = false |
|
|
|
|
|
isAllLevelReturn = false |
|
|
|
|
|
) |
|
|
|
|
|
if CommissionParam.IsShare != 0 { |
|
|
|
|
|
isShare = true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if CommissionParam.IsAllLevelReturn != 0 { |
|
|
|
|
|
isAllLevelReturn = true |
|
|
|
|
|
} |
|
|
|
|
|
var mapData = map[string]string{ |
|
|
|
|
|
"old_lv": CommissionParam.OldLv, |
|
|
|
|
|
"new_lv": CommissionParam.NewLv, |
|
|
|
|
|
"ownbuy_return_type": zhios_order_relate_utils.IntToStr(CommissionParam.OwnbuyReturnType), |
|
|
|
|
|
} |
|
|
|
|
|
virCfg, _ := db.SysCfgGetOne(eg, "virtual_coin_rebate_type") |
|
|
|
|
|
var virType = "price" |
|
|
|
|
|
if virCfg != nil && virCfg.Val != "" { |
|
|
|
|
|
virType = virCfg.Val |
|
|
|
|
|
} |
|
|
|
|
|
profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(eg, &CommissionParam.CommissionParam, isShare, CommissionParam.Uid, CommissionParam.Provider, dbName, isAllLevelReturn, mapData, virType) |
|
|
|
|
|
return profit, pvdFee, sysFee, subsidyFee, lvUser, err |
|
|
|
|
|
} |