Browse Source

1

tags/v1.7.4
DengBiao 2 years ago
parent
commit
a3e7d2a38e
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      rule/small_public_platoon_relate_commission.go

+ 3
- 5
rule/small_public_platoon_relate_commission.go View File

@@ -258,12 +258,11 @@ func smallPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, userPublicPl


//唯一标识符(父级id-uid-等级-位置) //唯一标识符(父级id-uid-等级-位置)
var uniqueIdentifier = zhios_order_relate_utils.IntToStr(pid) + "-" + zhios_order_relate_utils.IntToStr(uid) + "-" + zhios_order_relate_utils.IntToStr(int(level)) + "-" + zhios_order_relate_utils.IntToStr(position) var uniqueIdentifier = zhios_order_relate_utils.IntToStr(pid) + "-" + zhios_order_relate_utils.IntToStr(uid) + "-" + zhios_order_relate_utils.IntToStr(int(level)) + "-" + zhios_order_relate_utils.IntToStr(position)
<<<<<<< HEAD
if userPublicPlatoonSetting.SettleDay == 0 { if userPublicPlatoonSetting.SettleDay == 0 {
userPublicPlatoonSetting.SettleDay = 30 userPublicPlatoonSetting.SettleDay = 30
} }
// 3、插入 user_public_platoon_relation 记录
=======

// 3、改变直属父级的 has_son_num 数量 // 3、改变直属父级的 has_son_num 数量
update, err := engine.Where("position = ?", pid).SetExpr("has_son_num", "has_son_num + 1").Update(new(model.UserSmallPublicPlatoonRelation)) update, err := engine.Where("position = ?", pid).SetExpr("has_son_num", "has_son_num + 1").Update(new(model.UserSmallPublicPlatoonRelation))
if err != nil { if err != nil {
@@ -272,8 +271,8 @@ func smallPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, userPublicPl
if update == 0 { if update == 0 {
return userSmallPublicPlatoonRelation, errors.New("更新has_son_num数据出错") return userSmallPublicPlatoonRelation, errors.New("更新has_son_num数据出错")
} }

// 4、插入 user_public_platoon_relation 记录 // 4、插入 user_public_platoon_relation 记录
>>>>>>> 64fd8a9 (update)
now := time.Now() now := time.Now()
userSmallPublicPlatoonRelation.Uid = uid userSmallPublicPlatoonRelation.Uid = uid
userSmallPublicPlatoonRelation.FatherUid = fatherUid userSmallPublicPlatoonRelation.FatherUid = fatherUid
@@ -375,7 +374,6 @@ func smallReverseDeductionPosition(calcPosition, levelFirstPosition, severalTime
return return
} }



func smallFindSuitablePosition(engine *xorm.Engine, position *int, severalTimes float64, fatherLevel int) (suitablePosition, pid int, level float64, err error) { func smallFindSuitablePosition(engine *xorm.Engine, position *int, severalTimes float64, fatherLevel int) (suitablePosition, pid int, level float64, err error) {
firstSonPosition := smallSearchPositionFirstSonPosition(*position, int(severalTimes)) firstSonPosition := smallSearchPositionFirstSonPosition(*position, int(severalTimes))
var tempLevel float64 var tempLevel float64


Loading…
Cancel
Save