From 311ed3d0a5035852c0634ed028e598ee5c938560 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 25 Sep 2023 20:32:15 +0800 Subject: [PATCH] update --- rule/public_platoon_relate_commission.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rule/public_platoon_relate_commission.go b/rule/public_platoon_relate_commission.go index 2bc25d4..be6f00f 100644 --- a/rule/public_platoon_relate_commission.go +++ b/rule/public_platoon_relate_commission.go @@ -477,9 +477,14 @@ func JudgeUserBelowLevel(engine *xorm.Engine, uid int) (level int, err error) { return } - level = son.Level - 1 - levelEndPosition := getLevelForLastPosition(son.Level, userPublicPlatoonSetting.SeveralTimes) - if son.Position == levelEndPosition { + level = son.Level - m.Level + var list []model.UserPublicPlatoonRelation + if err = engine.Where("father_uid", son.FatherUid). + Find(&list); err != nil { + return + } + + if len(list) == userPublicPlatoonSetting.SeveralTimes { level++ } return