From e4623055874459c8efb95f1006ad6f7ee07172fe Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Mon, 13 Apr 2020 10:24:34 +0800 Subject: [PATCH] upt --- .../Controller/ExportController.class.php | 36 +++++++++---------- .../Controller/WorkOrderController.class.php | 32 ++++++++--------- .../Admin/View/WorkOrder/statistics.html | 4 +-- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index c9a91214f..939f07f44 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -9039,7 +9039,7 @@ class ExportController extends Controller $beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y")); $endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y")); $xlsData = M('promote', 'tab_')->alias('p') - ->field('p.id, p.level, p.account, count(u.id) as iosCount, count(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null)) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount') + ->field('count(distinct(u.id)) as iosCount, count(distinct(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null))) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount') ->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left') ->join("tab_user u on u.promote_id = p.id and u.device_type=2") ->where($map) @@ -9187,13 +9187,13 @@ class ExportController extends Controller $order = 'order by ' . $data_order_type . " " . ($data_order == 3 ? 'desc' : 'asc'); } $map = '1=1'; - if (!empty(I('user_account'))) { - $map .= " and t.account = '" . I('user_account') . "'"; + if (!empty(I('nickname'))) { + $map .= " and t.nickname = '" . I('nickname') . "'"; } // 获取所有传单或者接单用户id $userids = M('work_order_info', 'tab_') ->field("concat(creator_id, ',', handler_id) as userid") - ->join('tab_user as t on creator_id = t.id or handler_id = t.id') + ->join('sys_member as t on creator_id = t.uid or handler_id = t.uid') ->where($map) ->select(); if (empty($userids)) { @@ -9204,7 +9204,7 @@ class ExportController extends Controller $count = count($userids); $list = M('work_order_info', 'tab_')->query("SELECT t.id, - t.account, + t.nickname, sum(total_create_count) as total_create_count, sum(total_accepted_count) as total_accepted_count, sum(total_handle_count) as total_handle_count, @@ -9212,8 +9212,8 @@ class ExportController extends Controller FROM ( SELECT - u.id, - u.account, + u.uid as id, + u.nickname, count(*) AS total_create_count, count( @@ -9222,25 +9222,25 @@ class ExportController extends Controller NULL AS total_handle_count, NULL AS total_complete_count FROM - tab_user u - LEFT JOIN tab_work_order_info i ON i.creator_id = u.id + sys_member u + LEFT JOIN tab_work_order_info i ON i.creator_id = u.uid WHERE - u.id in ({$userids}) - GROUP BY u.id + u.uid in ({$userids}) + GROUP BY u.uid UNION SELECT - u.id, - u.account, + u.uid as id, + u.nickname, NULL AS total_create_count, NULL AS total_accepted_count, count(*) AS total_handle_count, count(IF(i.`status` = 1, 1, NULL)) AS total_complete_count FROM - tab_user u - LEFT JOIN tab_work_order_info i ON i.handler_id = u.id + sys_member u + LEFT JOIN tab_work_order_info i ON i.handler_id = u.uid WHERE - u.id in ({$userids}) - GROUP BY u.id + u.uid in ({$userids}) + GROUP BY u.uid ) AS t where {$map} GROUP BY t.id @@ -9249,7 +9249,7 @@ class ExportController extends Controller $xlsName = '工单统计报表'; $xlsCell = array( - array('account', "账号"), + array('nickname', "账号"), array('total_create_count', "发布工单数"), array('total_accepted_count', '被接手工单数'), array('total_handle_count', "接手工单数"), diff --git a/Application/Admin/Controller/WorkOrderController.class.php b/Application/Admin/Controller/WorkOrderController.class.php index bf52eef76..4377992aa 100644 --- a/Application/Admin/Controller/WorkOrderController.class.php +++ b/Application/Admin/Controller/WorkOrderController.class.php @@ -367,13 +367,13 @@ class WorkOrderController extends ThinkController $order = 'order by ' . $data_order_type . " " . ($data_order == 3 ? 'desc' : 'asc'); } $map = '1=1'; - if (!empty(I('user_account'))) { - $map .= " and t.account = '" . I('user_account') . "'"; + if (!empty(I('nickname'))) { + $map .= " and t.nickname = '" . I('nickname') . "'"; } // 获取所有传单或者接单用户id $userids = M('work_order_info', 'tab_') ->field("concat(creator_id, ',', handler_id) as userid") - ->join('tab_user as t on creator_id = t.id or handler_id = t.id') + ->join('sys_member as t on creator_id = t.uid or handler_id = t.uid') ->where($map) ->select(); if (empty($userids)) { @@ -384,7 +384,7 @@ class WorkOrderController extends ThinkController $count = count($userids); $list = M('work_order_info', 'tab_')->query("SELECT t.id, - t.account, + t.nickname, sum(total_create_count) as total_create_count, sum(total_accepted_count) as total_accepted_count, sum(total_handle_count) as total_handle_count, @@ -392,8 +392,8 @@ class WorkOrderController extends ThinkController FROM ( SELECT - u.id, - u.account, + u.uid as id, + u.nickname, count(*) AS total_create_count, count( @@ -402,25 +402,25 @@ class WorkOrderController extends ThinkController NULL AS total_handle_count, NULL AS total_complete_count FROM - tab_user u - LEFT JOIN tab_work_order_info i ON i.creator_id = u.id + sys_member u + LEFT JOIN tab_work_order_info i ON i.creator_id = u.uid WHERE - u.id in ({$userids}) - GROUP BY u.id + u.uid in ({$userids}) + GROUP BY u.uid UNION SELECT - u.id, - u.account, + u.uid as id, + u.nickname, NULL AS total_create_count, NULL AS total_accepted_count, count(*) AS total_handle_count, count(IF(i.`status` = 1, 1, NULL)) AS total_complete_count FROM - tab_user u - LEFT JOIN tab_work_order_info i ON i.handler_id = u.id + sys_member u + LEFT JOIN tab_work_order_info i ON i.handler_id = u.uid WHERE - u.id in ({$userids}) - GROUP BY u.id + u.uid in ({$userids}) + GROUP BY u.uid ) AS t where {$map} GROUP BY t.id diff --git a/Application/Admin/View/WorkOrder/statistics.html b/Application/Admin/View/WorkOrder/statistics.html index 18dd15a27..097b34ebd 100644 --- a/Application/Admin/View/WorkOrder/statistics.html +++ b/Application/Admin/View/WorkOrder/statistics.html @@ -56,7 +56,7 @@