getDbConnection()->createCommand($selectSql)->queryAll(); $taskType=array( 1=>'组卷--Word', 2=>"组卷--在线答题卡", 3=>'第三方--切割模板', 4=>'第三方--在线答题卡' ); $result=array(); if($data){ foreach ($data as $val){ $result[$val['task_type']]=$taskType[$val['task_type']]; } } return $result; } //查询任务数量 public function getTaskCount($examGroupId){ if(!$examGroupId){ return null; } $sql="select task_id,status from assist_student_scan_task where exam_group_id='{$examGroupId}'"; $data=$this->getDbConnection()->createCommand($sql)->queryAll(); $result=array(); $result['total']=count($data); $result['surplus']=0; $result['processed']=0; if($data){ foreach($data as $val){ if($val['status']==1){ $result['processed']++; }else{ $result['surplus']++; } } } return $result; } }