diff --git a/db/model/user_team_total.go b/db/model/user_team_total.go index 6fed8f5..a945ab2 100644 --- a/db/model/user_team_total.go +++ b/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)"` } diff --git a/lib/comm_plan/winery.go b/lib/comm_plan/winery.go index ef8a9ab..ab7eb3d 100644 --- a/lib/comm_plan/winery.go +++ b/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 }