sConn->createCommand($Sql." where ".$where)->queryRow(); $result['totalCount']=$dataCount['count']; $result['pageTotal']=ceil($dataCount['count']/$pagelimit); $offset=($page-1)*$pagelimit; $Sql="select zl_exam_group_id,zl_grade,zl_exam_name,zl_exam_date,e.zl_tpl_data from zl_exam_group eg join `zl_exam` e on eg.zl_exam_group_id=e.zl_exam_group_id "; $data=$this->sConn->createCommand($Sql." where ".$where." order by zl_create_time desc limit {$offset},{$pagelimit} ")->queryAll(); $result['data']=$data; return $result; } public function getExamByExamGroupId($examGroupId){ if(!$examGroupId) return false; $sql="select * from zl_exam where zl_exam_group_id='".$examGroupId."'"; return $this->sConn->createCommand($sql)->queryAll(); } public function getExamByExamId($examId){ if(!$examId) return false; $sql="select * from zl_exam where zl_exam_id='".$examId."'"; return $this->sConn->createCommand($sql)->queryRow(); } }