优化区服列表,隐藏操作,新增id

master
chenzhi 5 years ago
parent c1e16ed8d4
commit fe06fded2a

@ -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(){

@ -45,14 +45,14 @@
<div class="cf top_nav_list">
<div class="fl button_list">
<div class="tools">
<!-- 隐藏操作 -->
<!-- <div class="tools">
<empty name="show_status">
<a class=" " href="{:U('add?model='.$model['id'])}"><span class="button_icon button_icon1"></span>新增</a>
<a class=" " href="{:U('batch?model='.$model['id'])}"><span class="button_icon button_icon1"></span>批量添加</a>
</empty>
<a class=" ajax-post confirm " target-form="ids" url="{:U('del?model='.$model['id'])}"><span class="button_icon button_icon2"></span>删除</a>
</div>
</div> -->
</div>
<!-- 高级搜索 -->
@ -126,10 +126,11 @@
</th>
<th>游戏名称</th>
<th>区服名称</th>
<th>区服ID</th>
<th>运营平台</th>
<th>显示状态</th>
<th>开服时间</th>
<th>操作</th>
<!-- <th>操作</th> -->
</tr>
</thead>
@ -143,27 +144,28 @@
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td >{$data.game_name}</td>
<td >{$data.server_name}</td>
<td >{:get_systems_name($data['server_version'])}</td>
<td >{$data.server_id}</td>
<td >{$data['server_version']}</td>
<td >
<div class="display_status">
<span class="display_butnbox">
<eq name='data.show_status' value='1'>
<a href="{:U('change_status',array('field'=>'show_status','value'=>0,'ids'=>$data['id']))}" class="ajax-get ">
已开启<!--开启-->
</a>
<else/>
<a href="{:U('change_status',array('field'=>'show_status','value'=>1,'ids'=>$data['id']))}" class="ajax-get " style="color:#ff0000">
已关闭<!--关闭-->
</a>
</eq>
</span>
</div>
<span class="display_butnbox">
<eq name='data.show_status' value='1'>
<a href="{:U('change_status',array('field'=>'show_status','value'=>0,'ids'=>$data['id']))}" class="ajax-get ">
已开启<!--开启-->
</a>
<else/>
<a href="{:U('change_status',array('field'=>'show_status','value'=>1,'ids'=>$data['id']))}" class="ajax-get " style="color:#ff0000">
已关闭<!--关闭-->
</a>
</eq>
</span>
</div>
</td>
<td >{:set_show_time($data['start_time'])}</td>
<td >
<td >{$data['start_time']}</td>
<!-- <td >
<a href="{:U('edit',array('model'=>$model['id'],'id'=>$data['id']))}">编辑</a>
<a class="ajax-get confirm " href="{:U('del',array('model'=>$model['id'],'ids'=>$data['id']))}">删除</a>
</td>
</td> -->
</tr>
</volist>
</empty>
@ -258,7 +260,7 @@ $(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Server/lists')}');
highlight_subnav("{:U('Server/lists')}");
$(function(){
//搜索功能
$("#search").click(function(){

Loading…
Cancel
Save