From aa88579e821124a21f090c2992f445b168fe7a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Fri, 12 Dec 2025 20:14:22 +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-=E6=B5=8B=E8=AF=95-bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Tasks.php | 1 + application/api/model/Tasks.php | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/application/api/controller/Tasks.php b/application/api/controller/Tasks.php index 88e9beb3..fb8b6832 100644 --- a/application/api/controller/Tasks.php +++ b/application/api/controller/Tasks.php @@ -21,6 +21,7 @@ class Tasks extends BaseCom public function dailyTasksList() { $user_id = $this->uid; + model('Tasks')->tasks_complete(20110,18);die; $reslut = model('Tasks')->dailyTasksList($user_id); return V($reslut['code'],$reslut['msg'], $reslut['data']); diff --git a/application/api/model/Tasks.php b/application/api/model/Tasks.php index 5d9b2242..7781c47a 100644 --- a/application/api/model/Tasks.php +++ b/application/api/model/Tasks.php @@ -326,14 +326,15 @@ class Tasks extends Model } $reslut = Db::name('vs_tasks_student')->where('id',$task_student['id'])->update($task_student_data); }else{ - if($current_progress > $task_info['target_quantity']){ - $current_progress = $task_info['target_quantity']; - } - if($task_info['target_quantity']==$current_progress){ - $is_completed = 1; - } if ($user_daily_tasks) { - $current_progress = $user_daily_tasks['current_progress'] +$current_progress; + if($user_daily_tasks['current_progress'] > $task_info['target_quantity']){ + $current_progress = $task_info['target_quantity']; + }else{ + $current_progress = $user_daily_tasks['current_progress'] +$current_progress; + } + if($task_info['target_quantity']==$current_progress){ + $is_completed = 1; + } $reslut = Db::name('vs_tasks_user_daily')->where('id',$user_daily_tasks['id'])->update([ 'current_progress' => $current_progress, 'is_completed'=> $is_completed,