AdminUsersController.php 1.0 KB
<?php
/**
 * Created by PhpStorm.
 * User: ruidiudiu
 * Date: 2018/11/20
 * Time: 14:26
 */

namespace app\portal\controller;


use app\portal\model\UsersModel;
use cmf\controller\AdminBaseController;
/**
 * Class AdminUsersController
 * @package app\portal\controller
 * @adminMenuRoot(
 *     'name'   =>'用户管理',
 *     'action' =>'index',
 *     'parent' =>'',
 *     'display'=> true,
 *     'order'  => 30,
 *     'icon'   =>'th',
 *     'remark' =>'用户管理'
 * )
 */
class AdminUsersController extends AdminBaseController{

    public function index(){
        $param=$this->request->param();
        $where=[];
        if (!empty($param['keyword'])){
            $where['mobile']=['like','%'.$param['keyword'].'%'];
        }
        $users=new UsersModel();
        $data=$users->where($where)->order('create_time','desc')->paginate(10);
        $data->appends($param);
        $this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : '');
        $this->assign('data',$data);
        return $this->fetch();
    }



}