PageController.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Created by PhpStorm.
* User: 29925
* Date: 2018/8/9
* Time: 9:46
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
/**
* Class PageController
* @package app\admin\controller
* @adminMenuRoot(
* 'name' =>'页面二维码管理',
* 'action' =>'index',
* 'parent' =>'',
* 'display'=> true,
* 'order' => 1,
* 'icon' =>'columns',
* 'remark' =>'页面二维码管理'
* )
*/
class PageController extends AdminBaseController
{
protected $table;
public function _initialize()
{
$this->table = 'Page';
}
public function index() {
$param = $this->request->param();
$where = [];
if(isset($param['keyword'])) {
$where['name|values'] = ['like','%'.$param['keyword'].'%'];
}
$list = $this->singleData($this->table,$where,2,['create_time'=>'DESC']);
$list->appends($param);
$this->assign('list',$list->items());
$this->assign('page',$list->render());
$this->assign('keyword',isset($param['keyword']) ? $param['keyword'] : '');
return $this->fetch();
}
}