|
@@ -76,12 +76,24 @@ func BatchSmallGetPublicPlatoonRelateCommission(engine *xorm.Engine, masterId st |
|
|
fatherPositions := strings.Split(userPublicPlatoonRelation.FatherUid, "-") |
|
|
fatherPositions := strings.Split(userPublicPlatoonRelation.FatherUid, "-") |
|
|
var fatherPosition string |
|
|
var fatherPosition string |
|
|
userPublicPlatoonRelation.ReturnCommissionNum++ |
|
|
userPublicPlatoonRelation.ReturnCommissionNum++ |
|
|
|
|
|
|
|
|
remainder1 := (userPublicPlatoonRelation.ReturnCommissionNum) % len(fatherPositions) |
|
|
|
|
|
if remainder1 == 0 { |
|
|
|
|
|
fatherPosition = fatherPositions[len(fatherPositions)-1] |
|
|
|
|
|
|
|
|
userPublicPlatoonSetting, err := db.UserPublicPlatoonSettingGetOneByParams(engine, map[string]interface{}{ |
|
|
|
|
|
"key": "is_open", |
|
|
|
|
|
"value": 1, |
|
|
|
|
|
}) |
|
|
|
|
|
if len(fatherPositions) > userPublicPlatoonSetting.SeveralTimes { |
|
|
|
|
|
remainder1 := (userPublicPlatoonRelation.ReturnCommissionNum) % userPublicPlatoonSetting.SeveralTimes |
|
|
|
|
|
if remainder1 == 0 { |
|
|
|
|
|
fatherPosition = fatherPositions[len(fatherPositions)-1] |
|
|
|
|
|
} else { |
|
|
|
|
|
fatherPosition = fatherPositions[remainder1-1] |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
fatherPosition = fatherPositions[remainder1-1] |
|
|
|
|
|
|
|
|
remainder1 := (userPublicPlatoonRelation.ReturnCommissionNum) % len(fatherPositions) |
|
|
|
|
|
if remainder1 == 0 { |
|
|
|
|
|
fatherPosition = fatherPositions[len(fatherPositions)-1] |
|
|
|
|
|
} else { |
|
|
|
|
|
fatherPosition = fatherPositions[remainder1-1] |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
nowBenefitUsers, err := db.UserSmallPublicPlatoonRelationGetOneByParams(engine, map[string]interface{}{ |
|
|
nowBenefitUsers, err := db.UserSmallPublicPlatoonRelationGetOneByParams(engine, map[string]interface{}{ |
|
|