From bd3ffd9a0aefe7e3e754face9bf15f6c9906775b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Thu, 11 Dec 2025 20:07:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8A=9F=E8=83=BD=E6=8F=90?= =?UTF-8?q?=E4=BA=A4-=E8=81=94=E8=B0=83-=E4=BF=AE=E6=94=B9=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Tasks.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/application/api/model/Tasks.php b/application/api/model/Tasks.php index f71c698a..2fe30d44 100644 --- a/application/api/model/Tasks.php +++ b/application/api/model/Tasks.php @@ -276,12 +276,17 @@ class Tasks extends Model return ['code' => 0, 'msg' => '任务不存在或已删除','data' => null]; } if($ext_value==1){ - $current_progress = $task_student['value']+1; - if($task_info['target_quantity']==$current_progress && $task_student['is_reward']==1){ - $task_student_data['status'] = 1; - $is_completed = 1; + if($task_info['target_quantity'] >= $task_student['value']){ + return ['code' => 1, 'msg' => '操作成功','data' => ['is_completed'=>1]]; + }else{ + $current_progress = $task_student['value']+1; + if($task_info['target_quantity']==$current_progress && $task_student['is_reward']==1){ + $task_student_data['status'] = 1; + $is_completed = 1; + } + $task_student_data['value'] = $current_progress; } - $task_student_data['value'] = $current_progress; + }else{ $current_progress = $task_student['value']; if($task_info['target_quantity']==$current_progress){ @@ -409,7 +414,7 @@ class Tasks extends Model $op_bag_re = $this->open_tasks_bag($user_id,$task_info['tasks_bag_id']); if ($op_bag_re['code'] != 1) { Db::rollback(); - return ['code' => 0, 'msg' => '操作失败', 'data' => null]; + return ['code' => 0, 'msg' => $op_bag_re['msg'], 'data' => null]; } // 提交事务 Db::commit();