From ba89d6a16e4211868bfdb77a2625d756a835cf5b Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 14 Jul 2022 17:08:50 +0800 Subject: [PATCH] =?UTF-8?q?add=20reverse:for=20v1.4.4=20=E5=88=86=E4=BD=A3?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/relate_commission.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rule/relate_commission.go b/rule/relate_commission.go index 1e1884e..bb723c7 100644 --- a/rule/relate_commission.go +++ b/rule/relate_commission.go @@ -37,11 +37,9 @@ func BatchGetCommissionByGoods(eg *xorm.Engine, dbName string, commissionParamLi if param.IsShare != 0 { isShare = true } - if param.IsAllLevelReturn != 0 { isAllLevelReturn = true } - if param.GoodsId == "" { return errors.New("商品ID缺失") } @@ -86,6 +84,8 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar for _, param := range CommissionParamList { param := param // 为下面的闭包创建局部变量 group.Go(func() error { + defer mu.Unlock() + mu.Lock() if param.IsShare != 0 { isShare = true } @@ -103,7 +103,6 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar if err != nil { return err } - mu.Lock() goodsId2lvUser[param.Oid] = &comm_plan.SettleCommissionToGuide{ Profit: profit, PvdFee: pvdFee, @@ -111,7 +110,6 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar SubsidyFee: subsidyFee, LvUser: lvUser, } - mu.Unlock() return nil })