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,