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