任务功能提交-联调-修改错误

This commit is contained in:
2025-12-11 19:16:19 +08:00
parent 3ae792815c
commit 18eab7ea4c

View File

@@ -268,6 +268,7 @@ class Tasks extends Model
if ($user_daily_tasks && $user_daily_tasks['is_completed'] == 1) {
return ['code' => 0, 'msg' => '您已完成该任务','data' => null];
}
$is_completed = 0;
if(in_array($task_id,[21,22,23])){
$task_student_data =[];
$task_student = Db::name('vs_tasks_student')->where(['user_id'=>$user_id,'task_id'=>$task_id,'student_id'=>$student_id,'status'=>0,'delete_time'=>0])->find();
@@ -278,18 +279,19 @@ class Tasks extends Model
$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;
}else{
$current_progress = $task_student['value'];
if($task_info['target_quantity']==$current_progress){
$task_student_data['status'] = 1;
$is_completed = 1;
}
$task_student_data['is_reward'] = 1;
}
$reslut = Db::name('vs_tasks_student')->where('id',$task_student['id'])->update($task_student_data);
}else{
$is_completed = 0;
if($task_info['target_quantity']==$current_progress){
$is_completed = 1;
}