ajaxReturn($result); } } public function getResourceList() { $map = []; $keyword = I('post.keyword'); if (!empty($keyword)) { $map['title|docuat'] = array('like', '%' . $keyword . '%'); } $list = M("retail_resource") ->where($map) ->page($_POST['page'], $_POST['limit']) ->order('time desc') ->select(); $count = count(M("retail_news")->select()); foreach ($list as $k => &$val) { $val['index'] = round(($_POST['page'] - 1) * $_POST['limit'] + $k + 1); } $res['code'] = 0; $res['msg'] = ''; $res['data'] = $list; $res['count'] = $count; $this->ajaxReturn($res); } public function getResourceDetail() { $id = I('get.id'); $content = M('retail_resource')->where(array('id' => $id))->getField('content'); $content = htmlspecialchars_decode($content); $this->assign('content', $content); $this->display(); } }