sConn->createCommand($sql)->queryAll(); $examIds=array(); if($data){ if($hasFeedback){ foreach ($data as $val){ $examIds[]=$val['exam_id']; } $studentSql="select student_id,is_feedback,is_del from student_paper_relation where exam_id in(".implode(',',$examIds).")"; $studentData=$this->sConn->createCommand($studentSql)->queryAll(); if($studentData){ foreach ($studentData as $val){ if($val['is_feedback']==1){ $result['is_feedback']++; } if($val['is_del']==1){ $result['is_del']++; }else{ $result['total']++; } } } } $abnormalSql="select status from assist_student_scan_task where exam_group_id = '{$examGroupId}'"; $abnormalData=$this->conn->createCommand($abnormalSql)->queryAll(); if($abnormalData){ $result['abnormal']=count($abnormalData); foreach ($abnormalData as $val){ if($val['status']==0){ $result['surplus']++; } if($val['status']==1){ $result['complete']++; } } } } return $result; } //查询待处理数据 public function getSurplusDataByExamGroupId($examGroupId){ $abnormalSql="select status,task_id,`data` from assist_student_scan_task where exam_group_id = '{$examGroupId}' and status=0"; $abnormalData=$this->conn->createCommand($abnormalSql)->queryAll(); $result=array(); if($abnormalData){ foreach ($abnormalData as $val){ $result[]=array( 'task_id'=>$val['task_id'], 'student'=>$val['data'] ); } } return $result; } }