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'); }