|
|
@@ -1,6 +1,7 @@ |
|
|
|
package rule |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/db" |
|
|
|
"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/svc" |
|
|
@@ -24,7 +25,11 @@ func BatchGetCommission(eg *xorm.Engine, dbName string, commissionParamList []*m |
|
|
|
|
|
|
|
group, _ := errgroup.WithContext(context.Background()) |
|
|
|
var mu sync.Mutex |
|
|
|
|
|
|
|
virCfg := db.SysCfgFindWithDb(eg, dbName, "virtual_coin_rebate_type") |
|
|
|
var virType = "price" |
|
|
|
if virCfg["virtual_coin_rebate_type"] != "" { |
|
|
|
virType = virCfg["virtual_coin_rebate_type"] |
|
|
|
} |
|
|
|
for _, param := range commissionParamList { |
|
|
|
param := param // 为下面的闭包创建局部变量 |
|
|
|
group.Go(func() error { |
|
|
@@ -40,7 +45,7 @@ func BatchGetCommission(eg *xorm.Engine, dbName string, commissionParamList []*m |
|
|
|
return errors.New("商品ID缺失") |
|
|
|
} |
|
|
|
|
|
|
|
_, _, _, _, lvUser, err := svc.GetRewardCommission(eg, ¶m.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, map[string]string{}) |
|
|
|
_, _, _, _, lvUser, err := svc.GetRewardCommission(eg, ¶m.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, map[string]string{}, virType) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|