From b3d73847ed57ff68fc0db43733fea018a9559914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=B1=BC=E5=BC=80=E5=8F=91?= Date: Fri, 12 Jul 2024 22:25:43 +0800 Subject: [PATCH] bo --- .../api/sylive/GroupsStatistics.php | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/market/controllers/api/sylive/GroupsStatistics.php b/market/controllers/api/sylive/GroupsStatistics.php index f0341486..cdad1b53 100644 --- a/market/controllers/api/sylive/GroupsStatistics.php +++ b/market/controllers/api/sylive/GroupsStatistics.php @@ -196,12 +196,12 @@ class GroupsStatistics extends BaseController $where_sort['kpi'] = 'beforeOrder'; $beforeOrderTotal = $this->mdSyliveActivityKpidata->count($where_sort); } - if ($sort == 'watch') { - $watch = $v['total']; - } else { - $where_sort['kpi'] = 'watch'; - $watch = $this->mdSyliveActivityKpidata->count($where_sort); - } +// if ($sort == 'watch') { +// $watch = $v['total']; +// } else { +// $where_sort['kpi'] = 'watch'; +// $watch = $this->mdSyliveActivityKpidata->count($where_sort); +// } if ($sort == 'order') { $orderTotal = $v['total']; } else { @@ -213,21 +213,21 @@ class GroupsStatistics extends BaseController $orderTotal = $this->mdSyliveActivityKpidata->count($where_sort); } - $livePV = $watchDuration = 0; - if ($channelId) { - $livePV = $this->mdSyliveViewlog->count([$levelId => $groupsId, 'activityId' => $activityId - , 'createTime>=' => $createTimeStart, 'createTime<=' => $createTimeEnd]); - $re_sum = $this->mdSyliveViewlog->sum('playDuration', [$levelId => $groupsId, 'activityId' => $activityId - , 'createTime>=' => $createTimeStart, 'createTime<=' => $createTimeEnd]); - if ($re_sum['playDuration']) { - $playDuration = ceil($re_sum['playDuration'] / 60); - $watchDuration = round($playDuration / $livePV); - } - } +// $livePV = $watchDuration = 0; +// if ($channelId) { +// $livePV = $this->mdSyliveViewlog->count([$levelId => $groupsId, 'activityId' => $activityId +// , 'createTime>=' => $createTimeStart, 'createTime<=' => $createTimeEnd]); +// $re_sum = $this->mdSyliveViewlog->sum('playDuration', [$levelId => $groupsId, 'activityId' => $activityId +// , 'createTime>=' => $createTimeStart, 'createTime<=' => $createTimeEnd]); +// if ($re_sum['playDuration']) { +// $playDuration = ceil($re_sum['playDuration'] / 60); +// $watchDuration = round($playDuration / $livePV); +// } +// } $biz = $this->getBiz($groupsId); $list[] = [ 'groupsName' => $groupsName, 'biz' => $biz, 'browse' => $browse, 'subscribe' => $subscribe - , 'beforeOrder' => $beforeOrderTotal, 'watch' => $watch, 'order' => $orderTotal, 'livePV' => $livePV, 'watchDuration' => $watchDuration]; + , 'beforeOrder' => $beforeOrderTotal, 'order' => $orderTotal]; } } } else { @@ -249,7 +249,7 @@ class GroupsStatistics extends BaseController $sort_order = 'beforeOrderTotal ' . $order; } $res = $this->mdSyliveGroups->select($where, "{$sort_order},groupsId desc", $page, $limit, - 'groupsId,groupsName,browse,subscribe,watch,beforeOrderTotal,orderTotal'); + 'groupsId,groupsName,browse,subscribe,beforeOrderTotal,orderTotal'); } foreach ($res as $v) { @@ -260,21 +260,21 @@ class GroupsStatistics extends BaseController $v['browse'] = intval($re_gro['browse']); $v['subscribe'] = intval($re_gro['subscribe']); $v['beforeOrderTotal'] = intval($re_gro['beforeOrderTotal']); - $v['watch'] = intval($re_gro['watch']); + //$v['watch'] = intval($re_gro['watch']); } else { $groupsId = intval($v['groupsId']); $groupsName = $v['groupsName'] ? $v['groupsName'] : '-'; } - $livePV = $watchDuration = 0; - if ($channelId) { - $livePV = $this->mdSyliveViewlog->count([$levelId => $groupsId, 'activityId' => $activityId]); - $re_sum = $this->mdSyliveViewlog->sum('playDuration', [$levelId => $groupsId, 'activityId' => $activityId]); - if ($re_sum['playDuration']) { - $playDuration = ceil($re_sum['playDuration'] / 60); - $watchDuration = round($playDuration / $livePV); - } - } +// $livePV = $watchDuration = 0; +// if ($channelId) { +// $livePV = $this->mdSyliveViewlog->count([$levelId => $groupsId, 'activityId' => $activityId]); +// $re_sum = $this->mdSyliveViewlog->sum('playDuration', [$levelId => $groupsId, 'activityId' => $activityId]); +// if ($re_sum['playDuration']) { +// $playDuration = ceil($re_sum['playDuration'] / 60); +// $watchDuration = round($playDuration / $livePV); +// } +// } if ($sort != 'order' && $itemId) {//有商品id,区分订单 $order = $this->mdSyliveActivityKpidata->count(['itemId>' => 0, $levelId => $groupsId, 'itemId' => $itemId, 'activityId' => $activityId]); } else { @@ -283,7 +283,7 @@ class GroupsStatistics extends BaseController $biz = $this->getBiz($groupsId); $list[] = [ 'groupsName' => $groupsName, 'biz' => $biz, 'browse' => $v['browse'], 'subscribe' => $v['subscribe'] - , 'beforeOrder' => $v['beforeOrderTotal'], 'watch' => $v['watch'], 'order' => $order, 'livePV' => $livePV, 'watchDuration' => $watchDuration]; + , 'beforeOrder' => $v['beforeOrderTotal'], 'order' => $order]; } } }