diff --git a/Application/Admin/Controller/SocietyInfoController.class.php b/Application/Admin/Controller/SocietyInfoController.class.php index 4423d2a57..a1167be06 100644 --- a/Application/Admin/Controller/SocietyInfoController.class.php +++ b/Application/Admin/Controller/SocietyInfoController.class.php @@ -71,14 +71,39 @@ class SocietyInfoController extends ThinkController $map['communication_time'] = array('elt', time() - $gap * 86400); } if (I('sociaty_level') && I('sociaty_level') != '0') $map['sociaty_level'] = I('sociaty_level'); + //获取分页数据 $query = $model->where($map)->order("communication_time desc"); $count = $query->count(); + if($_REQUEST['ids'] && $is_export) { + $map['id'] = ['in',$_REQUEST['ids']]; + } + $order_query = $query + ->where($map); + + if (I('data_order')) { + $data_order = reset(explode(',', $_REQUEST['data_order'])); + $data_order_type = end(explode(',', $_REQUEST['data_order'])); + + if ($data_order == 4 && $data_order_type == "create_time") { + $order_query = $order_query->order("create_time desc"); + } else if($data_order == 3 && $data_order_type == "create_time") { + $order_query = $order_query->order("create_time asc"); + } + + if ($data_order == 4 && $data_order_type == "communication_time") { + $order_query = $order_query->order("communication_time desc"); + } else if($data_order == 3 && $data_order_type == "communication_time") { + $order_query = $order_query->order("communication_time asc"); + } + + $this->assign('userarpu_order', $data_order); + $this->assign('userarpu_order_type', $data_order_type); + } + if($is_export){ $map['id'] = ['in',$_REQUEST['ids']]; - $parseData = $query->field("province, city, company_name, register_capital, functionary, phone, wechat, qq, game_type, game_name, join_platform, promote_scale,sociaty_level, turnover, address, league_info, is_potential, remark, interface_person, create_time, communication_time, create_account") - ->where($map) - ->order("communication_time desc") + $parseData = $order_query->field("province, city, company_name, register_capital, functionary, phone, wechat, qq, game_type, game_name, join_platform, promote_scale,sociaty_level, turnover, address, league_info, is_potential, remark, interface_person, create_time, communication_time, create_account") ->select(); foreach ($parseData as &$v) { $v['sociaty_level'] = $this->level[$v['sociaty_level']]; @@ -96,7 +121,7 @@ class SocietyInfoController extends ThinkController $this->export($head, $parseData, "公会信息-".date('Ymd')); return ; } else { - $societyInfos = $model->where($map)->order("communication_time desc")->field("*")->page($page,$row)->select(); + $societyInfos = $order_query->page($page,$row)->field("*")->select(); // dump($societyInfos);die(); } diff --git a/Application/Admin/View/SocietyInfo/lists.html b/Application/Admin/View/SocietyInfo/lists.html index 29495cd47..60652ab17 100644 --- a/Application/Admin/View/SocietyInfo/lists.html +++ b/Application/Admin/View/SocietyInfo/lists.html @@ -89,6 +89,8 @@ + +
@@ -165,8 +167,28 @@