浏览代码

update 共富制度

tags/v1.3.7
DengBiao 2 年前
父节点
当前提交
41ac53f3a5
共有 1 个文件被更改,包括 14 次插入4 次删除
  1. +14
    -4
      svc/public_platoon_relate_commission.go

+ 14
- 4
svc/public_platoon_relate_commission.go 查看文件

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


正在加载...
取消
保存