Sfoglia il codice sorgente

update 共富制度

tags/v1.9.0
DengBiao 2 anni fa
parent
commit
a0897fa002
2 ha cambiato i file con 18 aggiunte e 6 eliminazioni
  1. +1
    -1
      rule/small_public_platoon_relate_commission.go
  2. +17
    -5
      svc/small_public_platoon_relate_commission.go

+ 1
- 1
rule/small_public_platoon_relate_commission.go Vedi File

@@ -324,7 +324,7 @@ func smallPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, userPublicPl
fatherUidStr = zhios_order_relate_utils.IntToStr(m1.Id)
} else {
fatherUids := strings.Split(m1.FatherUid, "-")
if len(fatherUids) > userPublicPlatoonSetting.SeveralRows {
if len(fatherUids) >= userPublicPlatoonSetting.SeveralRows {
fatherUidStr = zhios_order_relate_utils.IntToStr(m1.Id) + "-" + strings.Join(fatherUids[0:userPublicPlatoonSetting.SeveralRows:len(fatherUids)], "-")
} else {
fatherUidStr = zhios_order_relate_utils.IntToStr(m1.Id) + "-" + m1.FatherUid


+ 17
- 5
svc/small_public_platoon_relate_commission.go Vedi File

@@ -76,12 +76,24 @@ func BatchSmallGetPublicPlatoonRelateCommission(engine *xorm.Engine, masterId st
fatherPositions := strings.Split(userPublicPlatoonRelation.FatherUid, "-")
var fatherPosition string
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 {
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{}{


Caricamento…
Annulla
Salva