4.0日常更新

This commit is contained in:
2019-10-08 16:34:17 +08:00
parent 07faf60918
commit e8795716ec
16 changed files with 177 additions and 211 deletions

View File

@@ -19,9 +19,8 @@ class Ad extends Admin{
*/
public function index(AdPlace $adp){
if ($this->request->isAjax()) {
$res = $adp->paginate(25, false, array(
'query' => $this->request->param()
));
$param = $this->request->param();
$res = $adp->paginate($this->request->pageConfig);
$data = $res->append(['show_type_text', 'status_text'])->toArray();
$this->data['data'] = $data;
@@ -104,9 +103,7 @@ class Ad extends Admin{
*/
public function lists(AdModel $ad){
if ($this->request->isAjax()) {
$res = $ad->paginate(25, false, array(
'query' => $this->request->param()
));
$res = $ad->paginate($this->request->pageConfig);
$data = $res->append(['cover','status_text'])->toArray();
$this->data['data'] = $data;
return $this->data;

View File

@@ -18,7 +18,12 @@ class Channel extends Admin{
public function index(ChannelModel $channel){
if($this->request->isAjax()){
$tree = $this->request->param('tree', 0);
$type = $this->request->param('type', 0);
$map = array();
if($type){
$map['type'] = $type;
}
$res = $channel->where($map)->order('sort asc, id asc')->select();

View File

@@ -20,9 +20,8 @@ class Client extends Admin{
*/
public function index(ClientModel $client){
if ($this->request->isAjax()) {
$res = $client->paginate(25, false, array(
'query' => $this->request->param()
));
$param = $this->request->param();
$res = $client->paginate($this->request->pageConfig);
$data = $res->toArray();
$this->data['data'] = $data;
return $this->data;

View File

@@ -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;
}
/**

View File

@@ -19,9 +19,7 @@ class Form extends Admin{
*/
public function index(FormModel $form){
if ($this->request->isAjax()) {
$res = $form->paginate(25, false, array(
'query' => $this->request->param()
));
$res = $form->paginate($this->request->pageConfig);
$data = $res->toArray();
$this->data['data'] = $data;
return $this->data;

View File

@@ -19,9 +19,7 @@ class Link extends Admin{
*/
public function index(LinkModel $link){
if ($this->request->isAjax()) {
$res = $link->paginate(25, false, array(
'query' => $this->request->param()
));
$res = $link->paginate($this->request->pageConfig);
$data = $res->toArray();
$this->data['data'] = $data;
return $this->data;

View File

@@ -18,19 +18,16 @@ class Seo extends Admin{
* @title 系统首页
*/
public function index(SeoRule $seo){
//读取规则列表
$map = array('status' => array('=', 0));
if($this->request->isAjax()){
//读取规则列表
$map = array('status' => array('=', 0));
$list = $seo->where($map)->order('sort asc')->paginate(10, false, array(
'query' => $this->request->param()
));
$res = $seo->where($map)->order('sort asc')->paginate($this->request->pageConfig);
$this->data['data'] = array(
'list' => $list,
'page' => $list->render()
);
return $this->data;
$this->data['data'] = $res->toArray();
return $this->data;
}
}
/**