4.0日常更新
This commit is contained in:
@@ -18,33 +18,34 @@ class Config extends Admin {
|
||||
* @title 系统首页
|
||||
*/
|
||||
public function index(ConfigModel $config) {
|
||||
$group = input('group', 0, 'trim');
|
||||
$name = input('name', '', 'trim');
|
||||
$system_config = Cache::get('system_config');
|
||||
if($this->request->isAjax()){
|
||||
$param = $this->request->param();
|
||||
$group = input('group', 0, 'trim');
|
||||
$name = input('name', '', 'trim');
|
||||
$system_config = Cache::get('system_config');
|
||||
|
||||
/* 查询条件初始化 */
|
||||
$map = array('status' => 1);
|
||||
if ($group) {
|
||||
$map['group'] = $group;
|
||||
/* 查询条件初始化 */
|
||||
$map = array('status' => 1);
|
||||
if ($group) {
|
||||
$map['group'] = $group;
|
||||
}
|
||||
|
||||
if ($name) {
|
||||
$map['name'] = array('like', '%' . $name . '%');
|
||||
}
|
||||
|
||||
$res = $config->where($map)->order('id desc')->paginate($this->request->pageConfig);
|
||||
|
||||
$data = $res->append(['type_text','group_text'])->toArray();
|
||||
$this->data['data'] = $data;
|
||||
return $this->data;
|
||||
}else{
|
||||
$data = array(
|
||||
'group_id' => $this->request->get('group', 0),
|
||||
);
|
||||
$this->data['data'] = $data;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
if ($name) {
|
||||
$map['name'] = array('like', '%' . $name . '%');
|
||||
}
|
||||
|
||||
$list = $config->where($map)->order('id desc')->paginate(25, false, array(
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
// 记录当前列表页的cookie
|
||||
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
||||
|
||||
$data = array(
|
||||
'page' => $list->render(),
|
||||
'group_id' => $group,
|
||||
'list' => $list,
|
||||
);
|
||||
$this->data['data'] = $data;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user