Parcourir la source

update 共富制度

tags/v1.3.7
DengBiao il y a 2 ans
Parent
révision
41ac53f3a5
1 fichiers modifiés avec 14 ajouts et 4 suppressions
  1. +14
    -4
      svc/public_platoon_relate_commission.go

+ 14
- 4
svc/public_platoon_relate_commission.go Voir le fichier

@@ -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,


Chargement…
Annuler
Enregistrer