任务功能提交-测试-bug修改

This commit is contained in:
2025-12-12 20:14:22 +08:00
parent c999f5af2b
commit aa88579e82
2 changed files with 9 additions and 7 deletions

View File

@@ -21,6 +21,7 @@ class Tasks extends BaseCom
public function dailyTasksList() public function dailyTasksList()
{ {
$user_id = $this->uid; $user_id = $this->uid;
model('Tasks')->tasks_complete(20110,18);die;
$reslut = model('Tasks')->dailyTasksList($user_id); $reslut = model('Tasks')->dailyTasksList($user_id);
return V($reslut['code'],$reslut['msg'], $reslut['data']); return V($reslut['code'],$reslut['msg'], $reslut['data']);

View File

@@ -326,14 +326,15 @@ class Tasks extends Model
} }
$reslut = Db::name('vs_tasks_student')->where('id',$task_student['id'])->update($task_student_data); $reslut = Db::name('vs_tasks_student')->where('id',$task_student['id'])->update($task_student_data);
}else{ }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) { 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([ $reslut = Db::name('vs_tasks_user_daily')->where('id',$user_daily_tasks['id'])->update([
'current_progress' => $current_progress, 'current_progress' => $current_progress,
'is_completed'=> $is_completed, 'is_completed'=> $is_completed,