完善用户中心内容模块

This commit is contained in:
2020-04-15 17:07:05 +08:00
parent 10b40f0071
commit 1d4d785721
5 changed files with 79 additions and 13 deletions

View File

@@ -34,12 +34,17 @@ class Content extends Base {
* @author molong <ycgpp@126.com>
*/
public function index() {
$param = $this->request->param();
if ($this->modelInfo['list_grid'] == '') {
return $this->error("列表定义不正确!", url('/admin/model/edit', array('id' => $this->modelInfo['id'])));
}
$order = "id desc";
$map = [];
if (isset($param['keyword']) && $param['keyword'] != '') {
$map[] = ['title', 'LIKE', '%'.$param['keyword'].'%'];
}
$list = $this->model->where($map)->order($order)->paginate($this->modelInfo['list_row'], false, array(
'query' => $this->request->param(),
));
@@ -50,7 +55,8 @@ class Content extends Base {
'page' => $list->render(),
'model_name' => $this->modelInfo['name'],
'model_id' => $this->modelInfo['id'],
'meta_title' => $this->modelInfo['title'].'列表'
'meta_title' => $this->modelInfo['title'].'列表',
'param' => $param
);
if ($this->modelInfo['template_list']) {
$template = 'admin/content/' . $this->modelInfo['template_list'];