作者 潘浩文
1 个管道 的构建 通过 耗费 0 秒

XIAOPAN

@@ -27,8 +27,13 @@ use cmf\controller\AdminBaseController; @@ -27,8 +27,13 @@ use cmf\controller\AdminBaseController;
27 class AdminUsersController extends AdminBaseController{ 27 class AdminUsersController extends AdminBaseController{
28 28
29 public function index(){ 29 public function index(){
  30 + $param=$this->request->param();
  31 + $where=[];
  32 + if (!empty($param['keyword'])){
  33 + $where['mobile']=['like','%'.$param['keyword'].'%'];
  34 + }
30 $users=new UsersModel(); 35 $users=new UsersModel();
31 - $data=$users->order('create_time','desc')->paginate(10); 36 + $data=$users->where('')->order('create_time','desc')->paginate(10);
32 $this->assign('data',$data); 37 $this->assign('data',$data);
33 return $this->fetch(); 38 return $this->fetch();
34 } 39 }
@@ -6,12 +6,7 @@ @@ -6,12 +6,7 @@
6 <li class="active"><a href="javascript:;">用户列表</a></li> 6 <li class="active"><a href="javascript:;">用户列表</a></li>
7 <!--<li><a href="{:url('AdminArticle/add')}">添加文章</a></li>--> 7 <!--<li><a href="{:url('AdminArticle/add')}">添加文章</a></li>-->
8 </ul> 8 </ul>
9 - <form class="well form-inline margin-top-20" method="post" action="{:url('AdminArticle/index')}">  
10 - 分类:  
11 - <select class="form-control" name="category" style="width: 140px;">  
12 - <option value='0'>全部</option>  
13 - {$category_tree|default=''}  
14 - </select> &nbsp;&nbsp; 9 + <form class="well form-inline margin-top-20" method="post" action="{:url('AdminUsers/index')}">
15 时间: 10 时间:
16 <input type="text" class="form-control js-bootstrap-datetime" name="start_time" 11 <input type="text" class="form-control js-bootstrap-datetime" name="start_time"
17 value="{$start_time|default=''}" 12 value="{$start_time|default=''}"
@@ -21,9 +16,9 @@ @@ -21,9 +16,9 @@
21 style="width: 140px;" autocomplete="off"> &nbsp; &nbsp; 16 style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
22 关键字: 17 关键字:
23 <input type="text" class="form-control" name="keyword" style="width: 200px;" 18 <input type="text" class="form-control" name="keyword" style="width: 200px;"
24 - value="{$keyword|default=''}" placeholder="请输入关键字..."> 19 + value="{$keyword|default=''}" placeholder="手机号">
25 <input type="submit" class="btn btn-primary" value="搜索"/> 20 <input type="submit" class="btn btn-primary" value="搜索"/>
26 - <a class="btn btn-danger" href="{:url('AdminArticle/index')}">清空</a> 21 + <a class="btn btn-danger" href="{:url('AdminUsers/index')}">清空</a>
27 </form> 22 </form>
28 <form class="js-ajax-form" action="" method="post"> 23 <form class="js-ajax-form" action="" method="post">
29 <table class="table table-hover table-bordered table-list"> 24 <table class="table table-hover table-bordered table-list">