搜索分页

<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]);
}

猜你喜欢

转载自www.cnblogs.com/gwhm/p/10223696.html