/** * 获取审核结果列表 * @param integer $cid [description] * @param integer $offset [description] * @param integer $limit [description] * @return [type] [description] * @author zhuyuping * @dateTime 2015-08-26 */ public function getAuditedList($type, $keyword, $offset = 0, $limit = 20, $state = 0) { $offset = abs(intval($offset)); $limit = abs(intval($limit)); //获取已审核信息 if (empty($state)) { $conditions = 'state = 0'; } else { $conditions = 'state in(-1,1)'; } if (!empty($type) && in_array($type, array('user', 'com')) && !empty($keyword)) { $keyword = trim($keyword); $conditions .= $type == 'user' ? " and username = '******'" : " and comname = '{$keyword}'"; } //获取列表基本信息 $re['list'] = Mbuslicense::find(array("columns" => "id,supid,cid,addtime,checktime,state,checkdesc,name,comname,username", "conditions" => $conditions, "order" => "addtime desc", "offset" => $offset, "limit" => $limit))->toArray(); //待审核数 $re['checkCount'] = Mbuslicense::count(array('conditions' => 'state = :state:', 'bind' => array('state' => Mbuslicense::NEEDCHECK))); //符合条件的信息条数 $re['count'] = Mbuslicense::count(array($conditions)); return $this->outputData($re); }