From f69b0ddf14a8f039d621c4d5350b22ec982cb73c Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 22 Mar 2021 09:16:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SocietyInfoController.class.php | 31 +++++++++++-- Application/Admin/View/SocietyInfo/lists.html | 43 ++++++++++++++++++- 2 files changed, 68 insertions(+), 6 deletions(-) diff --git a/Application/Admin/Controller/SocietyInfoController.class.php b/Application/Admin/Controller/SocietyInfoController.class.php index 4423d2a57..624f38e71 100644 --- a/Application/Admin/Controller/SocietyInfoController.class.php +++ b/Application/Admin/Controller/SocietyInfoController.class.php @@ -71,14 +71,37 @@ 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(); + + $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 +119,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 @@ 是否为意向客户 备注信息 对接人 - 录入时间 - 最后沟通时间 + + + + 录入时间▲ + + 录入时间▼ + 录入时间 + + + + + + + 最后沟通时间▲ + + 最后沟通时间▼ + 最后沟通时间 + + + 操作 @@ -429,6 +451,23 @@ return false; }); + $(".paixu").click(function () { + var that = $(this); + $data_order = that.attr('data-order'); + $order_type = '{$userarpu_order}'; + if ($order_type == '' || $order_type == '4') { + $(".sortBy").attr('name', 'data_order'); + val = '3,' + $data_order; + $(".sortBy").attr('value', val); + $("#search").click(); + } else if ($order_type == '3') { + $(".sortBy").attr('name', 'data_order'); + val = '4,' + $data_order; + $(".sortBy").attr('value', val); + $("#search").click(); + } + }); + $("#excel_back").click(function () { $(".search_list").show(); $(".excel_list").hide(); From 97fae33c433ddfdd8e25efbf121be8f0b293c7d9 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 22 Mar 2021 09:23:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/SocietyInfoController.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/SocietyInfoController.class.php b/Application/Admin/Controller/SocietyInfoController.class.php index 624f38e71..a1167be06 100644 --- a/Application/Admin/Controller/SocietyInfoController.class.php +++ b/Application/Admin/Controller/SocietyInfoController.class.php @@ -75,7 +75,9 @@ class SocietyInfoController extends ThinkController //获取分页数据 $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);