huangjiajun преди 1 година
родител
ревизия
8b02c72ae9
променени са 2 файла, в които са добавени 13 реда и са изтрити 6 реда
  1. +1
    -0
      db/model/user_team_total.go
  2. +12
    -6
      lib/comm_plan/winery.go

+ 1
- 0
db/model/user_team_total.go Целия файл

@@ -6,4 +6,5 @@ type UserTeamTotal struct {
TeamCount int `json:"team_count" xorm:"default 0 INT(11)"`
FirstCount int `json:"first_count" xorm:"default 0 INT(11)"`
SecondCount int `json:"second_count" xorm:"default 0 INT(11)"`
IsSet int `json:"is_set" xorm:"default 0 INT(11)"`
}

+ 12
- 6
lib/comm_plan/winery.go Целия файл

@@ -159,8 +159,13 @@ Loop:
// 同级奖
if node.ParentUser.LevelWeight == maxLevelWeight && count > peerNum {
if peerNum >= 1 && node.ParentUser.Lv >= 2 {
checkCond(eg, node.ParentUser.Uid, teamCountMin)
Check(eg, node.ParentUser.Uid, teamCountMin)
teamtotal := db.GetUserTeamTotal(eg, zhios_order_relate_utils.IntToStr(node.ParentUser.Uid))
if teamtotal != nil && teamtotal.IsSet == 1 {
node.ParentUser.IsFreeze = 0
} else {
checkCond(eg, node.ParentUser.Uid, teamCountMin)
node.ParentUser.IsFreeze = Check(eg, node.ParentUser.Uid, teamCountMin)
}
}
peerRate = 0
//同级奖励比例
@@ -267,7 +272,7 @@ func Check(eg *xorm.Engine, uid, teamCountMin int) int {
return isAllFreeze
}
func checkCond(eg *xorm.Engine, uid, teamCountMin int) (int, int) {
isfreeze := 0
isfreeze := 1
teamtotal := db.GetUserTeamTotal(eg, zhios_order_relate_utils.IntToStr(uid))
total := 0
if teamtotal == nil || teamtotal != nil && teamtotal.TeamCount < teamCountMin {
@@ -301,14 +306,15 @@ func checkCond(eg *xorm.Engine, uid, teamCountMin int) (int, int) {
teamtotal.TeamCount = nCount
eg.Where("uid=?", uid).Update(teamtotal)
}
if nCount < teamCountMin {
isfreeze = 1
}

total = nCount
}
} else {
total = teamtotal.TeamCount
}
if total >= teamCountMin {
isfreeze = 1
}
return isfreeze, total
}



Зареждане…
Отказ
Запис