diff --git a/application/api/model/Tasks.php b/application/api/model/Tasks.php index 4c447c59..572be23c 100644 --- a/application/api/model/Tasks.php +++ b/application/api/model/Tasks.php @@ -149,7 +149,7 @@ class Tasks extends Model ->whereTime('createtime', 'today') ->find(); }else{ - if($user_ids && $v['task_type'] == 1 && count($user_ids)>1){ + if(isset($user_ids) && $v['task_type'] == 1 && count($user_ids)>1){ $user_daily_tasks = Db::name('vs_tasks_user_daily')->whereIn('user_id',$user_ids)->where('task_id',$v['task_id'])->find(); }else{ $user_daily_tasks = Db::name('vs_tasks_user_daily')->where('user_id',$user_id)->where('task_id',$v['task_id'])->find(); @@ -487,7 +487,7 @@ class Tasks extends Model if($task_info['task_type']==2){ $user_daily_tasks = Db::name('vs_tasks_user_daily')->where('user_id',$user_id)->where('task_id',$task_id)->whereTime('createtime', 'today')->find(); }else{ - if($task_info['task_type'] == 1 && count($user_ids)>1){ + if(isset($user_ids) && $task_info['task_type'] == 1 && count($user_ids)>1){ $user_daily_tasks = Db::name('vs_tasks_user_daily')->whereIn('user_id',$user_ids)->where('task_id',$task_id)->find(); }else{ $user_daily_tasks = Db::name('vs_tasks_user_daily')->where('user_id',$user_id)->where('task_id',$task_id)->find();