Bläddra i källkod

update 共富制度

tags/v1.9.0
DengBiao 2 år sedan
förälder
incheckning
a0897fa002
2 ändrade filer med 18 tillägg och 6 borttagningar
  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 Visa fil

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


+ 17
- 5
svc/small_public_platoon_relate_commission.go Visa fil

@@ -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{}{


Laddar…
Avbryt
Spara