任务功能提交-测试-bug修改
This commit is contained in:
@@ -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']);
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user