From 4ec100c86905b92463f4a4a848434b4dec230b63 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 14 Dec 2024 14:17:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/user_upgrade.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rule/user_upgrade.go b/rule/user_upgrade.go index 95b9e1e..bd2a38a 100644 --- a/rule/user_upgrade.go +++ b/rule/user_upgrade.go @@ -106,7 +106,7 @@ func UserUpgradeTask(eg *xorm.Engine, uid, lv int) ([]map[string]string, error) "is_success": utils.IntToStr(isSuccess), } taskList = append(taskList, tmp) - if isSuccess == 1 || v.IsMustTask == 0 { //记录选做任务数量 + if isSuccess == 1 && v.IsMustTask == 0 { //记录选做任务数量 chooseNum++ } if isSuccess == 0 && v.IsMustTask == 1 { //必做任务未完成 @@ -116,7 +116,7 @@ func UserUpgradeTask(eg *xorm.Engine, uid, lv int) ([]map[string]string, error) if mustTaskErr == 1 { return taskList, errors.New("必做任务未完成") } - if level.ChoosableNum > chooseNum { //选做任务未完成 + if chooseNum < level.ChoosableNum { //选做任务未完成 return taskList, errors.New("选择任务未完成") } return taskList, nil