edit-sylive-rank_index

This commit is contained in:
lccsw
2022-11-07 20:30:58 +08:00
parent 6fbcc68f92
commit 344f7dc190
5 changed files with 58 additions and 28 deletions
@@ -44,7 +44,7 @@ class Sylive_data_entity{
$j_where = [
"{$t2}.activityId={$t1}.activityId",
"{$t2}.kpi='{$params['kpi']}'",
"{$t2}.type" => 0,
"{$t2}.type=0",
];
if($gtype=='gw'){//顾问
$where["{$t1}.organizationId>"] = 0;
@@ -393,15 +393,14 @@ class Sylive_data_entity{
$lists = [];
if($total){
$rows = $this->ci->mdSytActivityKpiData->select_groupby($groupby, $where, $order, $page, $page_size, $select);
$org_rows = [];
if($groupby=='cfUserId'){
$user_ids = implode(',',array_column($rows,'cfUserId'));
$user_rows = [];
if($user_ids){
$user_rows = $this->ci->user_model->map('userId','',["userId in ($user_ids)"=>null],'','','','userId,uname as name');
$org_rows = $this->ci->user_model->map('userId','',["userId in ($user_ids)"=>null],'','','','userId,uname as name');
}
}else{
$team_ids = implode(',',array_column($rows,'teamId2'));
$org_rows = [];
if($team_ids){
$org_rows = $this->ci->market_sylive_team_model->map('teamId','',["teamId in ($team_ids)"=>null],'','','','teamId,teamName as name');
}
@@ -409,10 +408,11 @@ class Sylive_data_entity{
$start = $page>1 ? ($page-1)*$page_size : 0;
foreach ($rows as $key=>$val) {
$org = $org_rows[$val[$groupby]] ? $org_rows[$val[$groupby]][0] : [];
if($groupby=='cfUserId'){
$org = $org_rows[$val['cfUserId']] ? $org_rows[$val['cfUserId']][0] : [];
$tip = $teamId==$val['cfUserId'] ? '本人' : '';
}else{
$org = $org_rows[$val['teamId2']] ? $org_rows[$val['teamId2']][0] : [];
$tip = $teamId==$val['teamId2'] ? '我的团队' : '';
}
$lists[] = [
+14 -9
View File
@@ -411,7 +411,6 @@ class Stic extends Admin{
$a_id = intval($info['a_id']);//活动id
$type = $params['type'] ? $params['type'] : 'browse';
if(strtotime($params['day'])){//根据日期排行
$biz_id = '';
$where = [
'activityId' => $a_id,
'kpi' => $type,
@@ -419,15 +418,21 @@ class Stic extends Admin{
];
if($params['gtype']=='area'){
$data = $this->sylive_data_entity->top_area_kpidata($where,$page,$size);
}elseif($params['gtype']=='gw') {
$where = [
'activityId' => $a_id,
'type' => 0,
'kpi' => $params['type']
];
$params['day'] && $where['day'] = date('Y-m-d',strtotime($params['day']));
$groupby = 'cfUserId';
$teamId = $this->uid;
$select = 'bizId as teamId2,cfUserId,count(id) as t';
$order = 't desc';
$data = $this->sylive_data_entity->top_kpidata($groupby,$where,$order,$page,$size,$select,$teamId);
}else{
if($params['gtype']=='gw'){
$biz_id = $this->uid;
}
if($params['gtype']=='biz'){
$biz_id = $this->sylive_entity->get_biz_id($this->session['org_id'],$this->group_id);
}
$gtype = $params['gtype'] ? $params['gtype'] : 'biz';
$data = $this->sylive_data_entity->top_biz_kpidata($where,$gtype,$page,$size,$biz_id);
$biz_id = $this->sylive_entity->get_biz_id($this->session['org_id'],$this->group_id);
$data = $this->sylive_data_entity->top_biz_kpidata($where,'biz',$page,$size,$biz_id);
}
}else{
if($params['gtype']=='area'){
+12 -5
View File
@@ -137,13 +137,13 @@ class Tstic extends Admin{
$browse_lists = $this->sylive_data_entity->top_team_lists($a_id,'browse',$o_where,1,10,$teamId);
$browse = [
'title' => '团队<span class="color-00a2ff">浏览</span>排行',
'url' => '/h5/market/sylive/tstic/rank?type=browse&skey='.$skey,
'url' => "/h5/market/sylive/tstic/rank?type=browse&skey={$skey}&show_day=1",
'list' => $browse_lists['lists']
];
$book_lists = $this->sylive_data_entity->top_team_lists($a_id,'subscribe',$o_where,1,10,$teamId);
$book = [
'title' => '团队<span class="color-00a2ff">预约</span>排行',
'url' => '/h5/market/sylive/tstic/rank?type=subscribe&skey='.$skey,
'url' => "/h5/market/sylive/tstic/rank?type=subscribe&skey={$skey}&show_day=1",
'list' => $book_lists['lists']
];
$ty_browse_lists = $this->sylive_data_entity->top_team_user_lists($a_id,$type='browse',[], 1, 10,$this->uid);
@@ -297,12 +297,19 @@ class Tstic extends Admin{
//排名列表
public function rank(){
$params = $this->input->get();
!$params['day'] && $params['day'] = '全部';
$param = $this->myencryption->base64url_decode($this->data['skey']);
$a_id = intval($param['a_id']);//活动id
$row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
if(!$row){
throw new Hd_exception('参数错误',400);
}
$day_list = ['全部'];
$timeEnd = strtotime($row['timeEnd']);//直播结束往前七天
for($i=0;$i<8;$i++){
$day_list[] = date('Y-m-d',$timeEnd - $i*24*60*60);
}
$this->data['day_list'] = $day_list;
$this->data['params'] = $params;
//微信分享
$wx_info = $this->share_info($row);
@@ -331,7 +338,7 @@ class Tstic extends Admin{
'activityId' => $a_id,
'type' => 1
];
$params['day'] && $where['day'] = date('Y-m-d',strtotime($params['createTime']));
$params['day'] && $where['day'] = date('Y-m-d',strtotime($params['day']));
if($params['gtype']=='ty'){
$groupby = 'cfUserId';
$teamId = $this->uid;
@@ -556,8 +563,8 @@ class Tstic extends Admin{
}else{//大团长
$teamId = 0;
}
// $teamId && $o_where['teamId2'] = $teamId;
$res = $this->sylive_data_entity->top_team_lists($params['a_id'],$params['kpi'],$o_where,$page,$size,$this->uid);
$teamId && $o_where['bizId'] = $teamId;
$res = $this->sylive_data_entity->top_team_user_lists($params['a_id'],$params['kpi'],$o_where,$page,$size,$this->uid);
$lists = [];
if($res['lists']){
foreach ($res['lists'] as $item) {
+8 -8
View File
@@ -84,8 +84,8 @@
<div class="font-32 color-666" v-for="(item,index) in begin.area_browse.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="item.ranking<4" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+item.ranking+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</span>
<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>
@@ -106,8 +106,8 @@
<div class="font-32 color-666" v-for="(item,index) in begin.area_book.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="item.ranking<4" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+item.ranking+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</span>
<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>
@@ -287,8 +287,8 @@
<div class="font-32 color-666" v-for="(item,index) in live.area_view.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="item.ranking<4" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+item.ranking+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</span>
<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>
@@ -306,8 +306,8 @@
<div class="font-32 color-666" v-for="(item,index) in live.area_order.list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
<img class="imgsize-42X42 text-middle" v-if="item.ranking<4" :src="'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-ranking-'+item.ranking+'.png'" alt="#" />
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</span>
<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>
+19 -1
View File
@@ -2,7 +2,14 @@
<div id="app" ref="app">
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pt30 pb50">
<div class="relative bg-fff ml30 mr30 inner30 ulib-r20 box-shadow-darkGray" style="min-height:90vh;">
<div class="pt10 pb20 text-center"><b class="font-40 text-italic" v-html="title"></b></div>
<div class="pt10 pb20 fn-clear <?=$params['show_day'] ? '' : 'text-center '?>">
<b class="font-40 text-italic <?=$params['show_day'] ? 'fn-fl' : ''?>" v-html="title"></b>
<?if($params['show_day']){?>
<select class="fn-fr select-more ulib-r10 font-28" @change="changeCheckDate" v-model="checkDate">
<option :value="item" v-for="item in day_list">{{item}}</option>
</select>
<?}?>
</div>
<div class="font-32 color-666" v-for="(item,index) in list">
<div class="pt20 pb20 fn-clear">
<div class="fn-fl wp70 text-nowrap">
@@ -36,6 +43,7 @@
title:'',
list:[],
checkDate:'<?=$params['day']?>',
day_list : <?=json_encode($day_list,JSON_UNESCAPED_UNICODE)?>,
},
created(){
@@ -85,6 +93,16 @@
},'json');
}
},
//选择日期
changeCheckDate(e){
this.checkDate = e.target.value;
this.loading = false;
this.isDataEnd = false;
this.isNoData = false;
this.page = 1;
this.list = [];
this.getMoreList();
},
},
})
</script>