Browse Source

update 共富制度

tags/v1.3.7
DengBiao 2 years ago
parent
commit
41ac53f3a5
1 changed files with 14 additions and 4 deletions
  1. +14
    -4
      svc/public_platoon_relate_commission.go

+ 14
- 4
svc/public_platoon_relate_commission.go View File

@@ -79,12 +79,22 @@ func BatchGetPublicPlatoonRelateCommissionByOrder(engine *xorm.Engine, masterId
fatherPositions := strings.Split(userPublicPlatoonRelation.FatherUid, "-")
var fatherPosition string
userPublicPlatoonRelation.ReturnCommissionNum++
remainder := (userPublicPlatoonRelation.ReturnCommissionNum) % userPublicPlatoonSetting.SeveralRows
if remainder == 0 {
fatherPosition = fatherPositions[userPublicPlatoonSetting.SeveralRows-1]
if len(fatherPositions) < userPublicPlatoonSetting.SeveralRows {
remainder1 := (userPublicPlatoonRelation.ReturnCommissionNum) % len(fatherPositions)
if remainder1 == 0 {
fatherPosition = fatherPositions[len(fatherPositions)-1]
} else {
fatherPosition = fatherPositions[len(fatherPositions)-remainder1]
}
} else {
fatherPosition = fatherPositions[remainder-1]
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",
"value": fatherPosition,


Loading…
Cancel
Save