edit-sylive-stic_biz

This commit is contained in:
lccsw
2022-10-27 11:38:44 +08:00
parent b0c6065390
commit 45665b5282
2 changed files with 70 additions and 60 deletions
+68 -58
View File
@@ -66,25 +66,44 @@ class Stic extends Admin{
if(!$row && $this->group_id>=3){
$this->show_json([],200);
}
$biz = $join = [];
$area_name = '';
$area = $biz = $join = [];
if($this->group_id<2){ //所有大区
$biz_id = $this->input->get('biz_id');
$sql = "select count(distinct areaId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
$area_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
$sql = "select count(distinct bizId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
$biz_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
$where = [
'status' => 0,
"organizationId in (select organizationId from lc_market_sylive_organization where
if(!$this->group_id) {
$sql = "select count(distinct areaId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
$area_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
$sql = "select count(distinct bizId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
$biz_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
$where = [
'status' => 0,
"organizationId in (select organizationId from lc_market_sylive_organization where
parentId in (select bizId from lc_market_sylive_activity_biz where activityId={$a_id} and status=0)
)" => null
];
$gw_count = $this->user_model->count($where); //顾问
$join = [
['title' => '参与大区', 'num' => "{$area_count['total']}"],
['title' => '参与门店', 'num' => "{$biz_count['total']}"],
['title' => '参与人数', 'num' => "{$gw_count}"],
];
}
$where = [
'type' => 0,
'a_id' => $a_id,
'kpi' => 'browse',
];
$gw_count = $this->user_model->count($where); //顾问
$join = [
['title' => '参与大区', 'num' => "{$area_count['total']}"],
['title' => '参与门店', 'num' => "{$biz_count['total']}"],
['title' => '参与人数', 'num' => "{$gw_count}"],
$area_id = $this->sylive_entity->get_area_id($this->session['org_id'],$this->group_id);
$area_id && $where['area_id'] = $area_id;
$a_browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'subscribe';
$a_subscribe_count = $this->mdSytActivityKpiData->count($where); //订阅数据
$area = [
['title' => '访问用户', 'num' => "{$a_browse_count}",'url'=>"/h5/market/sylive/stic/users?type=area&type_id={$area_id}&kpi=browse&a_id={$a_id}"],
['title' => '预约用户', 'num' => "{$a_subscribe_count}",'url'=>"/h5/market/sylive/stic/users?type=area&type_id={$area_id}&kpi=subscribe&a_id={$a_id}"],
['title' => '预约率', 'num' => $a_browse_count ? round($a_subscribe_count/$a_browse_count*100,2)."%" : 0],
];
$area_name = $area_id ? '本域' : '全域';
}else{ //门店
$biz_id = $this->session['org_id'];
}
@@ -118,21 +137,6 @@ class Stic extends Admin{
['title' => '预约率', 'num' => $b_browse_count ? round($b_subscribe_count/$b_browse_count*100,2)."%" : 0],
];
}
$where = [
'type' => 0,
'a_id' => $a_id,
'kpi' => 'browse',
];
$area_id = $this->sylive_entity->get_area_id($this->session['org_id'],$this->group_id);
$area_id && $where['area_id'] = $area_id;
$a_browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'subscribe';
$a_subscribe_count = $this->mdSytActivityKpiData->count($where); //订阅数据
$area = [
['title' => '访问用户', 'num' => "{$a_browse_count}",'url'=>"/h5/market/sylive/stic/users?type=area&type_id={$area_id}&kpi=browse&a_id={$a_id}"],
['title' => '预约用户', 'num' => "{$a_subscribe_count}",'url'=>"/h5/market/sylive/stic/users?type=area&type_id={$area_id}&kpi=subscribe&a_id={$a_id}"],
['title' => '预约率', 'num' => $a_browse_count ? round($a_subscribe_count/$a_browse_count*100,2)."%" : 0],
];
$biz_id = $this->sylive_entity->get_biz_id($this->session['org_id'],$this->group_id);
$browse_lists = $this->sylive_entity->top_lists($a_id,'browse',1,10,$biz_id);
$browse = [
@@ -152,7 +156,8 @@ class Stic extends Admin{
'area' => $area,
'join' => $join,
'browse' => $browse,
'book' => $book
'book' => $book,
'area_name' => $area_name,
];
$this->show_json($data,200);
}
@@ -166,25 +171,44 @@ class Stic extends Admin{
if(!$row && $this->group_id>=3){
$this->show_json([],200);
}
$biz = $join = $view_num = $view_time = [];
$area_name = '';
$area = $biz = $join = $view_num = $view_time = [];
if($this->group_id<2){ //所有大区
$biz_id = $this->input->get('biz_id');
$sql = "select count(distinct areaId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
$area_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
$sql = "select count(distinct bizId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
$biz_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
if(!$this->group_id){
$sql = "select count(distinct areaId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
$area_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
$sql = "select count(distinct bizId) as total from lc_market_sylive_activity_biz where `activityId`={$a_id}";
$biz_count = $this->mdSytActivityBiz->db->query($sql)->row_array();
$where = [
'status' => 0,
"organizationId in (select organizationId from lc_market_sylive_organization where
parentId in (select bizId from lc_market_sylive_activity_biz where activityId={$a_id} and status=0)
)" => null
];
$gw_count = $this->user_model->count($where); //顾问
$join = [
['title' => '参与大区', 'num' => "{$area_count['total']}"],
['title' => '参与门店', 'num' => "{$biz_count['total']}"],
['title' => '参与人数', 'num' => "{$gw_count}"],
];
}
$where = [
'status' => 0,
"organizationId in (select organizationId from lc_market_sylive_organization where
parentId in (select bizId from lc_market_sylive_activity_biz where activityId={$a_id} and status=0)
)" => null
'type' => 0,
'a_id' => $a_id,
'kpi' => 'watch',
];
$gw_count = $this->user_model->count($where); //顾问
$join = [
['title' => '参与大区', 'num' => "{$area_count['total']}"],
['title' => '参与门店', 'num' => "{$biz_count['total']}"],
['title' => '参与人数', 'num' => "{$gw_count}"],
$area_id = $this->sylive_entity->get_area_id($this->session['org_id'],$this->group_id);
$area_id && $where['area_id'] = $area_id;
$a_view_count = $this->mdSytActivityKpiData->count($where); //观看数据
$where['kpi'] = 'order';
$a_order_count = $this->mdSytActivityKpiData->count($where); //下单数据
$area = [
['title' => '观看用户', 'num' => "{$a_view_count}",'url'=>"/h5/market/sylive/stic/users?type=area&type_id={$area_id}&kpi=watch&a_id={$a_id}"],
['title' => '下单用户', 'num' => "{$a_order_count}",'url'=>"/h5/market/sylive/stic/users?type=area&type_id={$area_id}&kpi=order&a_id={$a_id}"],
['title' => '转化率', 'num' => $a_view_count ? round($a_order_count/$a_view_count*100,2)."%" : 0],
];
$area_name = $area_id ? '本域' : '全域';
}else{ //门店
$biz_id = $this->session['org_id'];
// $view_num_lists = $this->sylive_entity->top_view_num($row['channelId'],1,10);
@@ -230,21 +254,6 @@ class Stic extends Admin{
['title' => '转化率', 'num' => $b_view_count ? round($b_order_count/$b_view_count*100,2)."%" : 0],
];
}
$where = [
'type' => 0,
'a_id' => $a_id,
'kpi' => 'watch',
];
$area_id = $this->sylive_entity->get_area_id($this->session['org_id'],$this->group_id);
$area_id && $where['area_id'] = $area_id;
$a_view_count = $this->mdSytActivityKpiData->count($where); //观看数据
$where['kpi'] = 'order';
$a_order_count = $this->mdSytActivityKpiData->count($where); //下单数据
$area = [
['title' => '观看用户', 'num' => "{$a_view_count}",'url'=>"/h5/market/sylive/stic/users?type=area&type_id={$area_id}&kpi=watch&a_id={$a_id}"],
['title' => '下单用户', 'num' => "{$a_order_count}",'url'=>"/h5/market/sylive/stic/users?type=area&type_id={$area_id}&kpi=order&a_id={$a_id}"],
['title' => '转化率', 'num' => $a_view_count ? round($a_order_count/$a_view_count*100,2)."%" : 0],
];
$total_play = $this->mdPolyvSession->sum('totalPlayDuration',['channelId'=>$row['channelId']]);
$duration = $this->mdPolyvSession->sum('duration',['channelId'=>$row['channelId']]);
$pv = $this->mdPolyvSession->sum('livePV',['channelId'=>$row['channelId']]);
@@ -281,6 +290,7 @@ class Stic extends Admin{
'order' => $order,
'view_num' => $view_num,
'view_time' => $view_time,
'area_name' => $area_name,
];
$this->show_json($data,200);
}
+2 -2
View File
@@ -40,7 +40,7 @@
</div>
<div class="relative mt30 bg-fff5ec overflowhidden ulib-r20" v-if="begin.area && begin.area.length>0">
<div class="orderTip text-center font-24 color-fff bg-ff5a5a">全域</div>
<div class="orderTip text-center font-24 color-fff bg-ff5a5a">{{begin.area_name}}</div>
<div class="fn-flex pl20 pr20 text-center">
<a class="fn-flex-item pt40 pb40" v-for="item in begin.area" :href="item.url">
<div class="font-32 color-fe9538">{{item.num}}</div>
@@ -127,7 +127,7 @@
</div>
<div class="relative mt30 bg-fff5ec overflowhidden ulib-r20" v-if="live.area && live.area.length>0">
<div class="orderTip text-center font-24 color-fff bg-ff5a5a">全域</div>
<div class="orderTip text-center font-24 color-fff bg-ff5a5a">{{live.area_name}}</div>
<div class="fn-flex pl20 pr20 text-center">
<a class="fn-flex-item pt40 pb40" v-for="item in live.area" :href="item.url">
<div class="font-32 color-fe9538">{{item.num}}</div>