/** * 获取电器故障列表 * @param object $condition 查询条件 * @param int $page 分页页数 * @param int $limit 每页显示的条数 * @return array */ public function index() { $page = I('page'); $condition = I('condition'); $limit = 10; $applianceTroubleLogic = new l\ApplianceTroubleLogic(); $troubleData = $applianceTroubleLogic->getTroubleList($condition, $page, $limit); $trouble_list = $troubleData['datas']; $current = $troubleData['current']; $list_count = $troubleData['allcount']; $pages = ceil($list_count / $limit); $data['error_code'] = $applianceTroubleLogic->getErrorCode(); $data['error_message'] = $applianceTroubleLogic->getErrorMessage(); $this->assign('pages', $pages); $this->assign('list_count', $list_count); $this->assign('current', $current); $this->assign('trouble_list', $trouble_list); $this->display(); }