From 1a2573ee801245e6dfee494132acc4822e519595 Mon Sep 17 00:00:00 2001 From: xiaoyu Date: Sat, 10 Feb 2024 02:11:01 +0800 Subject: [PATCH] 0210 --- market/controllers/api/sylive/GroupsStatistics.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/market/controllers/api/sylive/GroupsStatistics.php b/market/controllers/api/sylive/GroupsStatistics.php index 893c5c1d..a64450ad 100644 --- a/market/controllers/api/sylive/GroupsStatistics.php +++ b/market/controllers/api/sylive/GroupsStatistics.php @@ -772,7 +772,7 @@ class GroupsStatistics extends BaseController $where_order = ['activityId' => $activityId, 'day' => $day, "cfUserId>" => 0, 'itemId>' => 0]; $where_sort = ['activityId' => $activityId, 'day' => $day, "cfUserId>" => 0, 'kpi' => $sort]; if ($sort == 'order') { - $where = ['activityId' => $activityId, 'day' => $day, "cfUserId>" => 0, 'itemId>' => 0]; + $where = ['activityId' => $activityId, 'day' => $day, "cfUserId>" => 0, 'kpi' => $sort]; if ($itemId) { $where['itemId'] = $itemId; $where_order['itemId'] = $itemId; @@ -877,6 +877,9 @@ class GroupsStatistics extends BaseController $res = $this->mdSyliveActivityKpidata->select_groupby('cfUserId', $where, "orderTotal {$order},id desc" , $page, $limit, "cfUserId,levelId1,levelId2,levelId3,bizId,count(id) as orderTotal"); } else { + if ($sort == 'beforeOrder'){ + $sort_order = 'beforeOrderTotal ' . $order; + } $res = $this->mdSyliveGroupsUser->select($where, "{$sort_order},groupsUserId desc", $page, $limit, 'userId as cfUserId,levelId1,levelId2,levelId3,bizId,browse,subscribe,beforeOrderTotal,orderTotal,watch'); }