From 5418811d0ef6884f669850e895e2715d61f7264f Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Wed, 13 Jul 2022 20:27:22 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=85=B1=E5=AF=8C=E5=88=B6=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- svc/public_platoon_relate_commission.go | 42 ++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/svc/public_platoon_relate_commission.go b/svc/public_platoon_relate_commission.go index 8c365e6..8d890bc 100644 --- a/svc/public_platoon_relate_commission.go +++ b/svc/public_platoon_relate_commission.go @@ -16,13 +16,13 @@ import ( // BatchGetPublicPlatoonRelateCommission 批量分佣 订单显示 func BatchGetPublicPlatoonRelateCommissionByOrder(engine *xorm.Engine, masterId string, PublicPlatoonRelateCommissionReqList []*md.PublicPlatoonRelateCommissionReq) (map[string]*md.PublicPlatoonRelateCommissionResp, error) { var resp = make(map[string]*md.PublicPlatoonRelateCommissionResp) - userPublicPlatoonSetting, err := db.UserPublicPlatoonSettingGetOneByParams(engine, map[string]interface{}{ - "key": "is_open", - "value": 1, - }) - if err != nil { - return nil, err - } + //userPublicPlatoonSetting, err := db.UserPublicPlatoonSettingGetOneByParams(engine, map[string]interface{}{ + // "key": "is_open", + // "value": 1, + //}) + //if err != nil { + // return nil, err + //} for _, param := range PublicPlatoonRelateCommissionReqList { // 根据供应商 rewardOpt, err := db.DbsPlanRewardByPvd(engine, param.Pvd) @@ -79,21 +79,21 @@ func BatchGetPublicPlatoonRelateCommissionByOrder(engine *xorm.Engine, masterId fatherPositions := strings.Split(userPublicPlatoonRelation.FatherUid, "-") var fatherPosition string userPublicPlatoonRelation.ReturnCommissionNum++ - if len(fatherPositions) < userPublicPlatoonSetting.SeveralRows { - remainder1 := (userPublicPlatoonRelation.ReturnCommissionNum) % len(fatherPositions) - if remainder1 == 0 { - fatherPosition = fatherPositions[len(fatherPositions)-1] - } else { - fatherPosition = fatherPositions[len(fatherPositions)-remainder1] - } + //if len(fatherPositions) < userPublicPlatoonSetting.SeveralRows { + remainder1 := (userPublicPlatoonRelation.ReturnCommissionNum) % len(fatherPositions) + if remainder1 == 0 { + fatherPosition = fatherPositions[len(fatherPositions)-1] } else { - remainder2 := (userPublicPlatoonRelation.ReturnCommissionNum) % userPublicPlatoonSetting.SeveralRows - if remainder2 == 0 { - fatherPosition = fatherPositions[userPublicPlatoonSetting.SeveralRows-1] - } else { - fatherPosition = fatherPositions[remainder2-1] - } - } + fatherPosition = fatherPositions[len(fatherPositions)-remainder1] + } + //} else { + // remainder2 := (userPublicPlatoonRelation.ReturnCommissionNum) % userPublicPlatoonSetting.SeveralRows + // if remainder2 == 0 { + // fatherPosition = fatherPositions[userPublicPlatoonSetting.SeveralRows-1] + // } else { + // fatherPosition = fatherPositions[remainder2-1] + // } + //} nowBenefitUsers, err := db.UserPublicPlatoonRelationGetOneByParams(engine, map[string]interface{}{ "key": "position",