edit-sylive-static

This commit is contained in:
lccsw
2022-12-12 15:11:37 +08:00
parent 46a9d54c58
commit 378273cee6
6 changed files with 47 additions and 25 deletions
@@ -63,7 +63,7 @@ class Sylive2_data_entity{
$biz = $biz_rows[$val['bizId']] ? $biz_rows[$val['bizId']][0] : [];
$tip = $tagId==$val['cfUserId'] ? '本人' : '';
$name = $org['name'];
$biz && $name.="{$biz['groupsName']}";
$biz && $name="{$biz['groupsName']} {$name}";
$headimg = $org['headimg'];
}
$lists[] = [
@@ -89,7 +89,7 @@ class Sylive2_data_entity{
$lists = [];
if($total){
$rows = $this->ci->groups_user_model->select_groupby($groupby, $where, $order, $page, $page_size, $select);
$target_rows = [];
$biz_rows = $target_rows = [];
if($groupby=='bizId'){
$biz_ids = implode(',',array_column($rows,'tagId'));
$biz_ids && $target_rows = $this->ci->groups_model->map('groupsId','',["groupsId in ($biz_ids)"=>null],'','','','groupsId,groupsName');
@@ -97,8 +97,10 @@ class Sylive2_data_entity{
$biz_ids = implode(',',array_column($rows,'tagId'));
$biz_ids && $target_rows = $this->ci->groups_model->map('groupsId','',["groupsId in ($biz_ids)"=>null],'','','','groupsId,groupsName');
}else{
$biz_ids = implode(',',array_column($rows,'tagId'));
$biz_ids && $target_rows = $this->ci->user_model->map('userId','',["userId in ($biz_ids)"=>null],'','','','userId,uname as name,headimg');
$taget_ids = implode(',',array_column($rows,'tagId'));
$taget_ids && $target_rows = $this->ci->user_model->map('userId','',["userId in ($taget_ids)"=>null],'','','','userId,uname as name,headimg');
$biz_ids = implode(',',array_column($rows,'bizId'));
$biz_ids && $biz_rows = $this->ci->groups_model->map('groupsId','',["groupsId in ($biz_ids)"=>null],'','','','groupsId,groupsName');
}
$start = $page>1 ? ($page-1)*$page_size : 0;
$num_tip = $kpi == 'order' ? '单' : '人';
@@ -112,8 +114,10 @@ class Sylive2_data_entity{
$biz = $target_rows[$val['tagId']][0];
$name = $biz['groupsName'];
}else{
$biz = $target_rows[$val['tagId']][0];
$name = $biz['name'];
$target = $target_rows[$val['tagId']][0];
$name = $target['name'];
$biz = $biz_rows[$val['bizId']] ? $biz_rows[$val['bizId']][0] : [];
$biz && $name="{$biz['groupsName']} {$name}";
}
$lists[] = [
'ranking' => $start+$key+1,
@@ -180,6 +180,7 @@ class Admin extends Common{
try{
$this->session = $_SESSION[self::SESSION_KEY];
$this->mobile = $this->session['mobile'];
$_SESSION[self::SESSION_KEY]['act_uid'] = '';
if(!in_array($method,$this->white_login_method) && !$_SESSION[self::SESSION_KEY]['mobile'] && !$this->uid){
$ret = $this->set_auth();
$openid = $ret['openid'];
@@ -66,6 +66,8 @@ class Login extends CI_Controller{
$wx_info['headimgurl'] && $update['headimg'] = strval($wx_info['headimgurl']);
$wx_info['unionid'] && $update['unionid'] = $wx_info['unionid'];
$this->user_model->update($update,['mobile'=>$mobile,'status'=>0,'organizationId>'=>0]);
//普通用户禁用
$this->user_model->update(['status'=>-1],['openid'=>$wx_info['openid'],'status'=>0,'organizationId'=>0]);
return ['code' => 1,'msg' => '绑定成功'];
}
//获取验证码
+25 -18
View File
@@ -76,11 +76,12 @@ class Stic extends Admin{
$where = [
'activityId' => $this->a_id,
'status' => 0,
'bizId>' => 0
];
$gw_total = $this->groups_user_model->count($where);
$where["userId in (select cfUserId from lc_market_sylive_activity_kpidata where activityId={$this->a_id})"] = null;
$kgw_total = $this->groups_user_model->count($where);
$where = [
'activityId' => $this->a_id,
];
$kgw_total = $this->mdSytActivityKpiData->count($where,"cfUserId");
$h_lists[] = ['title'=>'参与门店','num'=>"{$biz_total}"];
$h_lists[] = ['title'=>'参与顾问','num'=>"{$gw_total}"];
$h_lists[] = ['title'=>'开工顾问','num'=>"{$kgw_total}"];
@@ -120,17 +121,20 @@ class Stic extends Admin{
}
if($group_row['groupsId']!=$group_user['bizId']){
if(!$group_row['groupsLevel'] && !$group_row['ifBiz']){//顶级
$b_sum = $this->groups_model->sum('browse',['groupsLevel'=>1,'activityId'=>$this->a_id]);
$sub_sum = $this->groups_model->sum('subscribe',['groupsLevel'=>1,'activityId'=>$this->a_id]);
$browse_count = $b_sum['browse'];//浏览数据
$subscribe_count = $sub_sum['subscribe'];//订阅数据
$browse_count = $this->mdSytActivityKpiData->count(['activityId' => $this->a_id, 'kpi' => 'browse']);
$subscribe_count = $this->mdSytActivityKpiData->count(['activityId' => $this->a_id, 'kpi' => 'subscribe']);
}else{
$browse_count = $group_row['browse'];//浏览数据
$subscribe_count = $group_row['subscribe'];//订阅数据
}
$b_url = $sub_url = '';
if($group_row['ifBiz']){
$b_url = "/h5/market/sylive2/stic/users?type=biz&type_id={$group_row['groupsId']}&kpi=browse";
$sub_url = "/h5/market/sylive2/stic/users?type=biz&type_id={$group_row['groupsId']}&kpi=subscribe";
}
$biz = [
['title'=>'访问用户','num'=>"{$browse_count}"],
['title'=>'预约用户','num'=>"{$subscribe_count}"],
['title'=>'访问用户','num'=>"{$browse_count}",'url'=>$b_url],
['title'=>'预约用户','num'=>"{$subscribe_count}",'url'=>$sub_url],
['title'=>'预约率','num'=>$browse_count ? round($subscribe_count/$browse_count*100,2)."%" : 0],
];
$title = $disk[$group_row['groupsLevel']+1]? '所有'.$disk[$group_row['groupsLevel']+1] : '所有门店';
@@ -201,17 +205,20 @@ class Stic extends Admin{
if($group_row['groupsId']!=$group_user['bizId']){
$disk = $this->sylive2_entity->level_disk($this->a_id);
if(!$group_row['groupsLevel'] && !$group_row['ifBiz']){//顶级
$b_sum = $this->groups_model->sum('watch',['groupsLevel'=>1,'activityId'=>$this->a_id]);
$sub_sum = $this->groups_model->sum('orderTotal',['groupsLevel'=>1,'activityId'=>$this->a_id]);
$browse_count = $b_sum['watch'];//观看数据
$subscribe_count = $sub_sum['orderTotal'];//下单数据
$browse_count = $this->mdSytActivityKpiData->count(['activityId' => $this->a_id, 'kpi' => 'watch']); //观看数据
$subscribe_count = $this->market_sylive_order_model->count(['activityId' => $this->a_id, 'status' => 1]); //下单数据
}else{
$browse_count = $group_row['watch'];//观看数据
$subscribe_count = $group_row['orderTotal'];//下单数据
}
$b_url = $sub_url = '';
if($group_row['ifBiz']){
$b_url = "/h5/market/sylive2/stic/users?type=biz&type_id={$group_row['groupsId']}&kpi=watch";
$sub_url = "/h5/market/sylive2/stic/users?type=biz&type_id={$group_row['groupsId']}&kpi=order";
}
$biz = [
['title'=>'观看用户','num'=>"{$browse_count}"],
['title'=>'下单数','num'=>"{$subscribe_count}"],
['title'=>'观看用户','num'=>"{$browse_count}",'url'=>$b_url],
['title'=>'下单数','num'=>"{$subscribe_count}",'url'=>$sub_url],
['title'=>'转化率','num'=>$browse_count ? round($subscribe_count/$browse_count*100,2)."%" : 0],
];
$title = $disk[$group_row['groupsLevel']+1]? '所有'.$disk[$group_row['groupsLevel']+1] : '所有门店';
@@ -390,7 +397,7 @@ class Stic extends Admin{
$params['itemId'] && $where['itemId'] = $params['itemId'];
$groupby = 'cfUserId';
$teamId = $this->uid;
$select = 'bizId,cfUserId as tagId,count(id) as t';
$select = 'cfUserId as tagId,count(id) as t';
$order = 't desc,id desc';
$res = $this->sylive2_data_entity->top_kpidata($groupby,$where,$order,$page,$size,$select,$teamId);
$lists = [];
@@ -428,7 +435,7 @@ class Stic extends Admin{
if($rows){
foreach ($rows as $item) {
$count = $this->groups_model->count(['activityId'=>$this->a_id,'status'=>0,'parentId'=>$item['groupsId']]);
$url = $note = '';
$note = '';
$url = "/h5/market/sylive2/stic?groupsId={$item['groupsId']}";
if(!$item['ifBiz']){
$note = $disk[$item['groupsLevel']+1] ? $disk[$item['groupsLevel']+1]:'门店';
@@ -545,7 +552,7 @@ class Stic extends Admin{
$where["$group_by>"] = 0;
}else{
$group_by = 'userId';
$select = "userId as tagId,sum({$kpi}) as t";
$select = "bizId,userId as tagId,sum({$kpi}) as t";
$where["$group_by>"] = 0;
}
$data = $this->sylive2_data_entity->top_groups_user($group_by,$where,'t desc,groupsUserId desc',$page,$size,$select,$params['kpi'],$group_user['bizId']);
+1 -1
View File
@@ -102,7 +102,7 @@
</a>
</div>
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"><span class="text-middle font-22">暂无数据</span></div>
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"><span class="text-middle font-22"></span></div>
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span></div>
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd&&list.length>10">我们是有底线的</div>
</mugen-scroll>
@@ -39,7 +39,9 @@
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</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>
<!--
<i class="iconfont icon-gengduo text-middle font-24 color-666"></i>
-->
</a>
<div class="fn-fr">{{item.num}}</div>
</div>
@@ -69,7 +71,9 @@
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</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>
<!--
<i class="iconfont icon-gengduo text-middle font-24 color-666"></i>
-->
</a>
<div class="fn-fr">{{item.num}}</div>
</div>
@@ -104,7 +108,9 @@
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</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>
<!--
<i class="iconfont icon-gengduo text-middle font-24 color-666"></i>
-->
</a>
<div class="fn-fr">{{item.num}}</div>
</div>
@@ -134,7 +140,9 @@
<span class="inline-block w-50 text-center text-middle" v-else>{{item.ranking}}</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>
<!--
<i class="iconfont icon-gengduo text-middle font-24 color-666"></i>
-->
</a>
<div class="fn-fr">{{item.num}}</div>
</div>