搜索分页

<link rel="stylesheet" href="__STATIC__/css/bootstrap.min.css"/>
<form action="{:url('index/sou')}" method="post">
<input type="text" placeholder="请输入管理员名称" name="word"/><input type="submit" value="搜用户"/>
public function sou(){
$word=Request::instance()->param("word");
$res=Db::table("user")
->where("phone","like","%$word%")
->whereOr("name","like","%$word%")
->paginate(3,false,['query'=>request()->param()]);
// print_r($res);
$this->assign('list', $res);
$count = Db::table("user")->count();

// 渲染模板输出
return $this->fetch("show",['arr'=>$res,'a'=>$count]);
}

posted @ 2019-01-05 11:07  垖垏尐  阅读(149)  评论(0编辑  收藏  举报