From fe06fded2abb418040e5b66b3168f64626e04e6f Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 26 Dec 2019 15:05:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8C=BA=E6=9C=8D=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=8C=E9=9A=90=E8=97=8F=E6=93=8D=E4=BD=9C=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9Eid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ServerController.class.php | 23 +++++++--- Application/Admin/View/Server/lists.html | 44 ++++++++++--------- 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/Application/Admin/Controller/ServerController.class.php b/Application/Admin/Controller/ServerController.class.php index bfdd48ea1..0af4e3057 100644 --- a/Application/Admin/Controller/ServerController.class.php +++ b/Application/Admin/Controller/ServerController.class.php @@ -10,7 +10,12 @@ use Admin\Event\BatchImportExcelEvent; class ServerController extends ThinkController { const model_name = 'Server'; - public function lists(){ + public function lists($p=0){ + $page = intval($p); + $page = $page ? $page : 1; //默认显示第一页数据 + $arraypage = $page; //默认显示第一页数据 + if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} + if(isset($_REQUEST['show_status'])){ $extend['show_status']=$_REQUEST['show_status']; unset($_REQUEST['show_status']); @@ -50,11 +55,19 @@ class ServerController extends ThinkController { $this->assign('show_status',1); } - $this->m_title = '区服列表'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Server/lists','status'=>1])->find()); - + $this->m_title = '区服列表'; + $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Server/lists','status'=>1])->find()); - parent::order_lists(self::model_name,$_GET["p"],$extend); + $data = M("Server","tab_")->field("id,game_name,server_name,server_id,show_status,start_time,server_version,developers")->where($extend)->page($page,$row)->select(); + foreach($data as $k=>&$v){ + $v["start_time"] = set_show_time($v["start_time"]); + $v["server_version"] = get_systems_name($v["server_version"]); + } + $count = M("Server","tab_")->where($extend)->count("id"); + $this->assign('list_data', $data); + $page = set_pagination($count,$row); + if($page) {$this->assign('_page', $page);} + $this->display(); } public function add(){ diff --git a/Application/Admin/View/Server/lists.html b/Application/Admin/View/Server/lists.html index a7ae99cff..8eaf145c6 100644 --- a/Application/Admin/View/Server/lists.html +++ b/Application/Admin/View/Server/lists.html @@ -45,14 +45,14 @@
- -
+ +
@@ -126,10 +126,11 @@ 游戏名称 区服名称 + 区服ID 运营平台 显示状态 开服时间 - 操作 + @@ -143,27 +144,28 @@ {$data.game_name} {$data.server_name} - {:get_systems_name($data['server_version'])} + {$data.server_id} + {$data['server_version']} + + + + 已开启 + + + + 已关闭 + + + +
- {:set_show_time($data['start_time'])} - + {$data['start_time']} + @@ -258,7 +260,7 @@ $(".select_gallery").select2();