|
@@ -37,11 +37,9 @@ func BatchGetCommissionByGoods(eg *xorm.Engine, dbName string, commissionParamLi |
|
|
if param.IsShare != 0 { |
|
|
if param.IsShare != 0 { |
|
|
isShare = true |
|
|
isShare = true |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if param.IsAllLevelReturn != 0 { |
|
|
if param.IsAllLevelReturn != 0 { |
|
|
isAllLevelReturn = true |
|
|
isAllLevelReturn = true |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if param.GoodsId == "" { |
|
|
if param.GoodsId == "" { |
|
|
return errors.New("商品ID缺失") |
|
|
return errors.New("商品ID缺失") |
|
|
} |
|
|
} |
|
@@ -86,6 +84,8 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar |
|
|
for _, param := range CommissionParamList { |
|
|
for _, param := range CommissionParamList { |
|
|
param := param // 为下面的闭包创建局部变量 |
|
|
param := param // 为下面的闭包创建局部变量 |
|
|
group.Go(func() error { |
|
|
group.Go(func() error { |
|
|
|
|
|
defer mu.Unlock() |
|
|
|
|
|
mu.Lock() |
|
|
if param.IsShare != 0 { |
|
|
if param.IsShare != 0 { |
|
|
isShare = true |
|
|
isShare = true |
|
|
} |
|
|
} |
|
@@ -103,7 +103,6 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return err |
|
|
return err |
|
|
} |
|
|
} |
|
|
mu.Lock() |
|
|
|
|
|
goodsId2lvUser[param.Oid] = &comm_plan.SettleCommissionToGuide{ |
|
|
goodsId2lvUser[param.Oid] = &comm_plan.SettleCommissionToGuide{ |
|
|
Profit: profit, |
|
|
Profit: profit, |
|
|
PvdFee: pvdFee, |
|
|
PvdFee: pvdFee, |
|
@@ -111,7 +110,6 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar |
|
|
SubsidyFee: subsidyFee, |
|
|
SubsidyFee: subsidyFee, |
|
|
LvUser: lvUser, |
|
|
LvUser: lvUser, |
|
|
} |
|
|
} |
|
|
mu.Unlock() |
|
|
|
|
|
|
|
|
|
|
|
return nil |
|
|
return nil |
|
|
}) |
|
|
}) |
|
|