PageController.php 1.1 KB
<?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();
    }
}