add-sylive-biz_rank
This commit is contained in:
@@ -156,6 +156,60 @@ class Sylive_entity{
|
||||
return $data;
|
||||
}
|
||||
|
||||
//门店用户排行数据
|
||||
public function top_biz_user($aid,$biz_id,$uid,$type='browse',$page=1,$size=50){
|
||||
$lists = [];
|
||||
$total = 0;
|
||||
$where = [
|
||||
'parentId' => $biz_id
|
||||
];
|
||||
$orgs = $this->ci->market_sylive_organization_model->select($where,'',0,0,'organizationId');
|
||||
$org_ids = 0;
|
||||
if($orgs){
|
||||
$org_arr_ids = array_column($orgs,'organizationId');
|
||||
$org_arr_ids[] = $biz_id;
|
||||
$org_ids = implode($org_arr_ids,',');
|
||||
}
|
||||
$where = [
|
||||
"organizationId in ({$org_ids})" => null
|
||||
];
|
||||
$total = $this->ci->user_model->count($where);
|
||||
$lists = [];
|
||||
if($total){
|
||||
$rows = $this->ci->user_model->select($where,'userId desc',$page,$size,'userId,uname,nickname,headimg');
|
||||
$where = [
|
||||
'a_id' => $aid,
|
||||
'kpi' => $type,
|
||||
'biz_id' => $biz_id
|
||||
];
|
||||
$t_rows = $this->ci->mdSytActivityKpiData->select_groupby('cf_uid',$where,'total desc',$page,$size,'cf_uid,count(id) as total');
|
||||
$map = [];
|
||||
if($t_rows){
|
||||
foreach($t_rows as $item) {
|
||||
$map[$item['cf_uid']] = null !== $item['total'] ? $item['total'] : $item;
|
||||
}
|
||||
}
|
||||
foreach ($rows as $item) {
|
||||
$total = $map[$item['userId']] ? $map[$item['userId']] : '0';
|
||||
$lists[] = [
|
||||
'uid' => $item['userId'],
|
||||
'name' => $item['uname'] ? $item['uname'] : $item['nickname'],
|
||||
'total' => $total,
|
||||
'num' => "{$total}人",
|
||||
'tip' => $uid == $item['userId'] ? '本人' : '',
|
||||
];
|
||||
}
|
||||
$edit = array_column($lists,'total');
|
||||
array_multisort($edit,SORT_DESC,$lists);
|
||||
}
|
||||
$data = [
|
||||
'total' => $total,
|
||||
'lists' => $lists
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public function __get($name)
|
||||
{
|
||||
if ('_model' === substr($name, -6)) {
|
||||
|
||||
@@ -262,7 +262,14 @@ class Stic extends Admin{
|
||||
$page = $params['page'] ? intval($params['page']) : 1;
|
||||
$info = $this->myencryption->base64url_decode($params['skey']);
|
||||
$a_id = intval($info['a_id']);//活动id
|
||||
$biz_id = $this->group_id==3 ? $this->session['org_id'] : 0;
|
||||
if($this->group_id==3){
|
||||
$org_row = $this->market_sylive_organization_model->get(['organizationId'=>$this->session['org_id']],'parentId');
|
||||
$biz_id = $org_row['parentId'] ? $org_row['parentId'] : 0;
|
||||
}elseif($this->group_id==2){
|
||||
$biz_id = $this->session['org_id'];
|
||||
}else{
|
||||
$biz_id = 0;
|
||||
}
|
||||
$type = $params['type'] ? $params['type'] : 'browse';
|
||||
$data = $this->sylive_entity->top_lists($a_id,$type,$page,10,$biz_id);
|
||||
$data['title'] = $title_arr[$type];
|
||||
@@ -328,6 +335,37 @@ class Stic extends Admin{
|
||||
'lists' => $lists,
|
||||
'total' => $total
|
||||
];
|
||||
if($this->group_id==3){
|
||||
$org_row = $this->market_sylive_organization_model->get(['organizationId'=>$this->session['org_id']],'parentId');
|
||||
$biz_id = $org_row['parentId'] ? $org_row['parentId'] : 0;
|
||||
}elseif($this->group_id==2){
|
||||
$biz_id = $this->session['org_id'];
|
||||
}else{
|
||||
$biz_id = 0;
|
||||
}
|
||||
if($type==1){
|
||||
$b_rows = $this->sylive_entity->top_biz_user($a_id,$biz_id,$this->uid,'browse');
|
||||
$data['browse'] = [
|
||||
'title' => '本店<span class="color-00a2ff">浏览</span>排行',
|
||||
'list' => $b_rows['lists']
|
||||
];
|
||||
$sub_rows = $this->sylive_entity->top_biz_user($a_id,$biz_id,$this->uid,'subscribe');
|
||||
$data['book'] = [
|
||||
'title' => '本店<span class="color-00a2ff">预约</span>排行',
|
||||
'list' => $sub_rows['lists']
|
||||
];
|
||||
}else{
|
||||
$view_rows = $this->sylive_entity->top_biz_user($a_id,$biz_id,$this->uid,'watch');
|
||||
$data['view'] = [
|
||||
'title' => '本店<span class="color-00a2ff">观看</span>排行',
|
||||
'list' => $view_rows['lists']
|
||||
];
|
||||
$order_rows = $this->sylive_entity->top_biz_user($a_id,$biz_id,$this->uid,'order');
|
||||
$data['order'] = [
|
||||
'title' => '本店<span class="color-00a2ff">订单</span>排行',
|
||||
'list' => $order_rows['lists']
|
||||
];
|
||||
}
|
||||
$this->show_json($data,200);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<img class="absolute left-0 box-middle ml35 imgsize-90X90 ulib-r750 bds-1-eee" :src="info.logo" :alt="info.title" />
|
||||
<div>
|
||||
<span class="font-36 text-middle">{{info.title}}</span>
|
||||
<span class="inline-block pl10 pr10 line-height-15 text-middle ulib-r750 font-22 color-fff bg-1a1a1a">专属客服</span>
|
||||
<span class="inline-block pl10 pr10 line-height-15 text-middle ulib-r750 font-22 color-fff bg-1a1a1a">专属顾问</span>
|
||||
</div>
|
||||
<div class="mt10 font-22 color-999">{{info.slogan}}</div>
|
||||
<a class="absolute right-0 box-middle mr30" :href="'tel:'+info.cust_tel">
|
||||
|
||||
@@ -28,6 +28,42 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20" v-if="begin.browse.list.length>0">
|
||||
<div class="pb20 fn-clear">
|
||||
<b class="fn-fl font-40 text-italic" v-html="begin.browse.title"></b>
|
||||
</div>
|
||||
<div class="font-32 color-666" v-for="(item,index) in begin.browse.list">
|
||||
<div class="pt20 pb20 fn-clear">
|
||||
<div class="fn-fl wp70 text-nowrap">
|
||||
<img class="imgsize-42X42 text-middle" v-if="index<3" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+(index+1)+'.png'" alt="#" />
|
||||
<span class="inline-block w-50 text-center text-middle" v-else>{{index+1}}</span>
|
||||
<span class="text-middle">{{item.name}}</span>
|
||||
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
|
||||
</div>
|
||||
<div class="fn-fr">{{item.num}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20" v-if="begin.book.list.length>0">
|
||||
<div class="pb20 fn-clear">
|
||||
<b class="fn-fl font-40 text-italic" v-html="begin.book.title"></b>
|
||||
</div>
|
||||
<div class="font-32 color-666" v-for="(item,index) in begin.book.list">
|
||||
<div class="pt20 pb20 fn-clear">
|
||||
<div class="fn-fl wp70 text-nowrap">
|
||||
<img class="imgsize-42X42 text-middle" v-if="index<3" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+(index+1)+'.png'" alt="#" />
|
||||
<span class="inline-block w-50 text-center text-middle" v-else>{{index+1}}</span>
|
||||
<span class="text-middle">{{item.name}}</span>
|
||||
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
|
||||
</div>
|
||||
<div class="fn-fr">{{item.num}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end 预热阶段-->
|
||||
<!--直播阶段-->
|
||||
@@ -42,6 +78,41 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20" v-if="live.view.list.length>0">
|
||||
<div class="pb20 fn-clear">
|
||||
<b class="fn-fl font-40 text-italic" v-html="live.view.title"></b>
|
||||
</div>
|
||||
<div class="font-32 color-666" v-for="(item,index) in live.view.list">
|
||||
<div class="pt20 pb20 fn-clear">
|
||||
<div class="fn-fl wp70 text-nowrap">
|
||||
<img class="imgsize-42X42 text-middle" v-if="index<3" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+(index+1)+'.png'" alt="#" />
|
||||
<span class="inline-block w-50 text-center text-middle" v-else>{{index+1}}</span>
|
||||
<span class="text-middle">{{item.name}}</span>
|
||||
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
|
||||
</div>
|
||||
<div class="fn-fr">{{item.num}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
|
||||
</div>
|
||||
|
||||
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20" v-if="live.order.list.length>0">
|
||||
<div class="pb20 fn-clear">
|
||||
<b class="fn-fl font-40 text-italic" v-html="live.order.title"></b>
|
||||
</div>
|
||||
<div class="font-32 color-666" v-for="(item,index) in live.order.list">
|
||||
<div class="pt20 pb20 fn-clear">
|
||||
<div class="fn-fl wp70 text-nowrap">
|
||||
<img class="imgsize-42X42 text-middle" v-if="index<3" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+(index+1)+'.png'" alt="#" />
|
||||
<span class="inline-block w-50 text-center text-middle" v-else>{{index+1}}</span>
|
||||
<span class="text-middle">{{item.name}}</span>
|
||||
<span class="inline-block pl10 pr10 line-height-15 text-middle bg-fe9538 font-22 color-fff ulib-r750" v-if="item.tip">{{item.tip}}</span>
|
||||
</div>
|
||||
<div class="fn-fr">{{item.num}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pt100 pb100 text-center font-32 color-666" v-else>暂时无数据</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end 直播阶段-->
|
||||
<!--实时动态-->
|
||||
@@ -88,9 +159,25 @@
|
||||
loading: false,
|
||||
begin:{
|
||||
cell1:<?=json_encode($info['begin'])?>,
|
||||
browse:{
|
||||
title:'',
|
||||
list:[],
|
||||
},
|
||||
book:{
|
||||
title:'',
|
||||
list:[],
|
||||
}
|
||||
},
|
||||
live:{
|
||||
cell1:<?=json_encode($info['live'])?>,
|
||||
view:{
|
||||
title:'',
|
||||
list:[],
|
||||
},
|
||||
order:{
|
||||
title:'',
|
||||
list:[],
|
||||
}
|
||||
},
|
||||
isDataEnd: false,
|
||||
isNoData: false,
|
||||
@@ -180,9 +267,6 @@
|
||||
if (!that.loading) {
|
||||
that.getDynamicList()
|
||||
that.loading = false;
|
||||
that.begin = {
|
||||
cell1:<?=json_encode($info['begin'])?>,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -192,9 +276,6 @@
|
||||
if (!that.loading) {
|
||||
that.getDynamicList()
|
||||
that.loading = false;
|
||||
that.live = {
|
||||
cell1:<?=json_encode($info['live'])?>,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -214,12 +295,18 @@
|
||||
that.page = that.page + 1;
|
||||
that.dynamic.title = '实时<span class="color-00a2ff">动态</span>';
|
||||
that.dynamic.list = that.dynamic.list.concat(res.data.lists);
|
||||
if(that.tabid==1){ //预热
|
||||
that.begin.browse = res.data.browse
|
||||
that.begin.book = res.data.book
|
||||
}else{ // 直播
|
||||
that.live.view = res.data.view
|
||||
that.live.order = res.data.order
|
||||
}
|
||||
if (res.data.total == 0) {
|
||||
that.isNoData = true;
|
||||
} else if (that.dynamic.list.length == res.data.total) {
|
||||
that.isDataEnd = true;
|
||||
}
|
||||
console.dir(that.begin)
|
||||
},'json');
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user