statistics_1030
This commit is contained in:
@@ -184,15 +184,17 @@ class Statistics extends BaseController
|
||||
$subscribe = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'type' => 0, 'kpi' => 'subscribe']);
|
||||
$watch = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'type' => 0, 'kpi' => 'watch']);
|
||||
$order = $this->mdSyliveOrder->count(['item_id' => $activityId, 'cfrom' => 0, 'status' => 1]);
|
||||
$duration = $livePV = $watchDuration = $watchDuration = $pvDuration = 0;
|
||||
$duration_min = $livePV = $watchDuration = $watchDuration = $pvDuration = 0;
|
||||
if ($channelId) {
|
||||
$re_duration = $this->mdPolyvSession->sum('duration', ['channelId' => $channelId]);
|
||||
if ($re_duration['duration']) {
|
||||
$re_liveUV = $this->mdPolyvSession->sum('liveUV', ['channelId' => $channelId]);
|
||||
$re_livePV = $this->mdPolyvSession->sum('livePV', ['channelId' => $channelId]);
|
||||
$duration = ceil($re_duration['duration'] / 60);
|
||||
$re_totalPlayDuration = $this->mdPolyvSession->sum('totalPlayDuration', ['channelId' => $channelId]);
|
||||
$duration_min = ceil($re_duration['duration'] / 60);
|
||||
$totalPlayDuration_min = ceil($re_totalPlayDuration['totalPlayDuration'] / 60);
|
||||
$livePV = $re_livePV['livePV'];
|
||||
$watchDuration = round($duration / $livePV);
|
||||
$watchDuration = round($totalPlayDuration_min / $re_livePV['liveUV']);
|
||||
$pvDuration = round($livePV / $re_liveUV['liveUV'], 1);
|
||||
}
|
||||
}
|
||||
@@ -208,7 +210,7 @@ class Statistics extends BaseController
|
||||
$url = "/sylive/activity/statistics/piechart?activityId={$activityId}&";
|
||||
$activityData2 = [['name' => '浏览数(人)', 'value' => $browse, 'url' => ''], ['name' => '预约数(人)', 'value' => $subscribe, 'url' => '']
|
||||
, ['name' => '观看数(人)', 'value' => $watch, 'url' => ''], ['name' => '订单数(单)', 'value' => $order, 'url' => '']
|
||||
, ['name' => '直播时长(分)', 'value' => $duration, 'url' => ''], ['name' => '观看数(人次)', 'value' => $livePV, 'url' => '']
|
||||
, ['name' => '直播时长(分)', 'value' => $duration_min, 'url' => ''], ['name' => '观看数(人次)', 'value' => $livePV, 'url' => '']
|
||||
, ['name' => '人均观看(分)', 'value' => $watchDuration, 'url' => ''], ['name' => '人均观看(次)', 'value' => $pvDuration, 'url' => '']];
|
||||
// $activityData2 = [['name' => '浏览数(人)', 'value' => $browse, 'url' => "{$url}kpi=browse"], ['name' => '预约数(人)', 'value' => $subscribe, 'url' => "{$url}kpi=subscribe"]
|
||||
// , ['name' => '观看数(人)', 'value' => $watch, 'url' => "{$url}kpi=watch"], ['name' => '订单数(单)', 'value' => $order, 'url' => "{$url}kpi=order"]
|
||||
|
||||
Reference in New Issue
Block a user