后台文件修改,修复搜索时分页链接会没有参数的情况
This commit is contained in:
@@ -21,7 +21,9 @@ class Action extends Admin {
|
||||
|
||||
$order = "id desc";
|
||||
//获取列表数据
|
||||
$list = model('Action')->where($map)->order($order)->paginate(10);
|
||||
$list = model('Action')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
|
||||
// 记录当前列表页的cookie
|
||||
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
||||
|
||||
@@ -27,7 +27,9 @@ class Ad extends Admin {
|
||||
$map = array();
|
||||
$order = "id desc";
|
||||
|
||||
$list = db('AdPlace')->where($map)->order($order)->paginate(10);
|
||||
$list = db('AdPlace')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
'page' => $list->render(),
|
||||
@@ -102,7 +104,9 @@ class Ad extends Admin {
|
||||
$map['place_id'] = $id;
|
||||
$order = "id desc";
|
||||
|
||||
$list = db('Ad')->where($map)->order($order)->paginate(10);
|
||||
$list = db('Ad')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
$data = array(
|
||||
'id' => $id,
|
||||
'list' => $list,
|
||||
@@ -118,7 +122,7 @@ class Ad extends Admin {
|
||||
if ($this->request->isPost()) {
|
||||
$result = $ad->change();
|
||||
if ($result) {
|
||||
return $this->success("添加成功!", url('admin/ad/lists', array('id' => $this->request->param('place_id'))));
|
||||
return $this->success("添加成功!", url('admin/ad/lists', array('id' => $this->param['place_id'])));
|
||||
} else {
|
||||
return $this->error($ad->getError());
|
||||
}
|
||||
@@ -139,7 +143,7 @@ class Ad extends Admin {
|
||||
if ($this->request->isPost()) {
|
||||
$result = $ad->change();
|
||||
if ($result) {
|
||||
return $this->success("修改成功!", url('admin/ad/lists', array('id' => $this->reqeust->param('place_id'))));
|
||||
return $this->success("修改成功!", url('admin/ad/lists', array('id' => $this->param['place_id'])));
|
||||
} else {
|
||||
return $this->error($ad->getError());
|
||||
}
|
||||
|
||||
@@ -28,7 +28,9 @@ class Addons extends Admin {
|
||||
if ($refresh) {
|
||||
$this->addons->refresh();
|
||||
}
|
||||
$list = $this->addons->order('id desc')->paginate(25);
|
||||
$list = $this->addons->order('id desc')->paginate(25, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
// 记录当前列表页的cookie
|
||||
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
||||
|
||||
@@ -216,7 +218,9 @@ class Addons extends Admin {
|
||||
|
||||
$map = array();
|
||||
$order = "id desc";
|
||||
$list = model('Hooks')->where($map)->order($order)->paginate(10);
|
||||
$list = model('Hooks')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
|
||||
// 记录当前列表页的cookie
|
||||
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
||||
|
||||
@@ -49,7 +49,9 @@ class Attribute extends Admin {
|
||||
if (!$model_id) {
|
||||
return $this->error('非法操作!');
|
||||
}
|
||||
$list = model('Attribute')->where('model_id', $model_id)->order('id desc')->paginate(25);
|
||||
$list = model('Attribute')->where('model_id', $model_id)->order('id desc')->paginate(25, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
@@ -67,7 +69,7 @@ class Attribute extends Admin {
|
||||
*/
|
||||
public function add($model_id = '') {
|
||||
if ($this->request->isPost()) {
|
||||
$result = $this->model->validate('attribute.add')->save($this->request->param());
|
||||
$result = $this->model->validate('attribute.add')->save($this->param);
|
||||
if (false !== $result) {
|
||||
return $this->success("创建成功!", url('Attribute/index', array('model_id' => $model_id)));
|
||||
} else {
|
||||
@@ -90,7 +92,7 @@ class Attribute extends Admin {
|
||||
*/
|
||||
public function edit($id = '', $model_id = '') {
|
||||
if ($this->request->isPost()) {
|
||||
$result = $this->model->validate('attribute.edit')->save($this->request->param(), array('id'=>$id));
|
||||
$result = $this->model->validate('attribute.edit')->save($this->param, array('id'=>$id));
|
||||
if ($result) {
|
||||
return $this->success("修改成功!", url('Attribute/index', array('model_id' => $model_id)));
|
||||
} else {
|
||||
|
||||
@@ -19,7 +19,9 @@ class Client extends Admin {
|
||||
|
||||
|
||||
public function index(){
|
||||
$list = $this->model->paginate(25);
|
||||
$list = $this->model->paginate(25, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
'page' => $list->render()
|
||||
|
||||
@@ -34,7 +34,9 @@ class Config extends Admin {
|
||||
$map['name'] = array('like', '%' . $name . '%');
|
||||
}
|
||||
|
||||
$list = $this->model->where($map)->order('id desc')->paginate(25);
|
||||
$list = $this->model->where($map)->order('id desc')->paginate(25, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
// 记录当前列表页的cookie
|
||||
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
||||
|
||||
|
||||
@@ -44,7 +44,9 @@ class Content extends Admin {
|
||||
$field = array_filter($grid_list['fields']);
|
||||
|
||||
|
||||
$list = $this->model->where($map)->order($order)->paginate($this->modelInfo['list_row']);
|
||||
$list = $this->model->where($map)->order($order)->paginate($this->modelInfo['list_row'], false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'grid' => $grid_list,
|
||||
@@ -67,7 +69,7 @@ class Content extends Admin {
|
||||
*/
|
||||
public function add() {
|
||||
if ($this->request->isPost()) {
|
||||
$result = $this->model->save($this->request->param());
|
||||
$result = $this->model->save($this->param);
|
||||
if ($result) {
|
||||
//记录行为
|
||||
action_log('add_content', 'content', $result, session('auth_user.uid'));
|
||||
@@ -100,7 +102,7 @@ class Content extends Admin {
|
||||
*/
|
||||
public function edit($id) {
|
||||
if ($this->request->isPost()) {
|
||||
$result = $this->model->save($this->request->param(), array('id'=> $id));
|
||||
$result = $this->model->save($this->param, array('id'=> $id));
|
||||
if ($result !== false) {
|
||||
//记录行为
|
||||
action_log('update_content', 'content', $result, session('auth_user.uid'));
|
||||
@@ -137,12 +139,12 @@ class Content extends Admin {
|
||||
* @author molong <ycgpp@126.com>
|
||||
*/
|
||||
public function del() {
|
||||
$param = $this->request->param();
|
||||
if (!$param['id'] || (is_array($param['id']) && empty($param['id']))) {
|
||||
$id = $this->getArrayParam('id');
|
||||
if (empty($id)) {
|
||||
return $this->error("非法操作!");
|
||||
}
|
||||
|
||||
$map['id'] = array('IN', $param['id']);
|
||||
$map['id'] = array('IN', $id);
|
||||
$result = $this->model->where($map)->delete();
|
||||
|
||||
if (false !== $result) {
|
||||
|
||||
@@ -27,7 +27,9 @@ class Form extends Admin {
|
||||
public function index() {
|
||||
$map = array();
|
||||
$order = "id desc";
|
||||
$list = $this->model->where($map)->order($order)->paginate(25);
|
||||
$list = $this->model->where($map)->order($order)->paginate(25, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
@@ -166,7 +168,7 @@ class Form extends Admin {
|
||||
}
|
||||
|
||||
public function addattr(\think\Request $request){
|
||||
$form_id = isset($this->request->param('form_id')) ? $this->request->param('form_id') : '';
|
||||
$form_id = isset($this->param['form_id']) ? $this->param['form_id'] : '';
|
||||
if (!$form_id) {
|
||||
return $this->error('非法操作!');
|
||||
}
|
||||
@@ -193,8 +195,8 @@ class Form extends Admin {
|
||||
}
|
||||
|
||||
public function editattr(\think\Request $request){
|
||||
$form_id = isset($this->request->param('form_id')) ? $this->request->param('form_id') : '';
|
||||
$id = isset($this->request->param('id')) ? $this->request->param('id') : '';
|
||||
$form_id = isset($this->param['form_id']) ? $this->param['form_id'] : '';
|
||||
$id = isset($this->param['id']) ? $this->param['id'] : '';
|
||||
if (!$form_id || !$id) {
|
||||
return $this->error('非法操作!');
|
||||
}
|
||||
@@ -219,7 +221,7 @@ class Form extends Admin {
|
||||
}
|
||||
|
||||
public function delattr(\think\Request $request){
|
||||
$id = isset($this->request->param('id')) ? $this->request->param('id') : 0;
|
||||
$id = isset($this->param['id']) ? $this->param['id'] : 0;
|
||||
if (!$id) {
|
||||
return $this->error('非法操作!');
|
||||
}
|
||||
|
||||
@@ -25,7 +25,9 @@ class Group extends Admin {
|
||||
public function index($type = 'admin') {
|
||||
$map['module'] = $type;
|
||||
|
||||
$list = db('AuthGroup')->where($map)->order('id desc')->paginate(10);
|
||||
$list = db('AuthGroup')->where($map)->order('id desc')->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
@@ -112,7 +114,9 @@ class Group extends Admin {
|
||||
public function access($type = 'admin') {
|
||||
$map['module'] = $type;
|
||||
|
||||
$list = db('AuthRule')->where($map)->order('id desc')->paginate(15);
|
||||
$list = db('AuthRule')->where($map)->order('id desc')->paginate(15, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
|
||||
@@ -16,7 +16,9 @@ class Link extends Admin {
|
||||
$map = array();
|
||||
|
||||
$order = "id desc";
|
||||
$list = db('Link')->where($map)->order($order)->paginate(10);
|
||||
$list = db('Link')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
|
||||
@@ -26,7 +26,9 @@ class Model extends Admin {
|
||||
$map = array('status' => array('gt', -1));
|
||||
|
||||
$order = "id desc";
|
||||
$list = $this->model->where($map)->order($order)->paginate(10);
|
||||
$list = $this->model->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
|
||||
@@ -25,7 +25,9 @@ class Seo extends Admin {
|
||||
//读取规则列表
|
||||
$map = array('status' => array('EGT', 0));
|
||||
|
||||
$list = $this->seo->where($map)->order('sort asc')->paginate(10);
|
||||
$list = $this->seo->where($map)->order('sort asc')->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
|
||||
@@ -17,20 +17,25 @@ class User extends Admin {
|
||||
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
|
||||
*/
|
||||
public function index() {
|
||||
$nickname = input('nickname');
|
||||
$param = $this->request->param();
|
||||
$map['status'] = array('egt', 0);
|
||||
if (is_numeric($nickname)) {
|
||||
$map['uid|nickname'] = array(intval($nickname), array('like', '%' . $nickname . '%'), '_multi' => true);
|
||||
} else {
|
||||
$map['nickname'] = array('like', '%' . (string) $nickname . '%');
|
||||
if (isset($param['nickname']) && $param['nickname']) {
|
||||
$map['nickname'] = array('like', '%' . $param['nickname'] . '%');
|
||||
}
|
||||
if (isset($param['username']) && $param['username']) {
|
||||
$map['username'] = array('like', '%' . (string) $param['nickname'] . '%');
|
||||
}
|
||||
|
||||
$order = "uid desc";
|
||||
$list = model('Member')->where($map)->order($order)->paginate(15);
|
||||
$list = model('Member')->where($map)->order($order)
|
||||
->paginate(15, false, array(
|
||||
'param' => $param
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
'page' => $list->render(),
|
||||
'param' => $param
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta('用户信息');
|
||||
|
||||
@@ -10,6 +10,23 @@
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-box-body clearfix">
|
||||
<div class="navbar navbar-default">
|
||||
<form action="" class="navbar-form form-inline" method="get">
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-order-id">用户名</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="username" value="{$param['username']|default=''}" placeholder="用户名" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-order-id">昵称</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="nickname" value="{$param['nickname']|default=''}" placeholder="昵称" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit"><i class="fa fa-search"></i> 筛选</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table user-list table-hover">
|
||||
<thead>
|
||||
@@ -39,7 +56,11 @@
|
||||
{volist name="list" id="item"}
|
||||
<tr>
|
||||
<td>
|
||||
<img src="{:avatar($item['uid'])}" alt=""/>
|
||||
{if $item['avatar_url']}
|
||||
<img src="{$item['avatar_url']}" alt="{$item['nickname']}"/>
|
||||
{else/}
|
||||
<img src="{:avatar($item['uid'])}" alt="{$item['nickname']}"/>
|
||||
{/if}
|
||||
<a href="#" class="user-link">{$item['nickname']}</a>
|
||||
<span class="user-subhead">{$item['username']}</span>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user