edit-sylive-team

This commit is contained in:
lccsw
2022-10-25 16:23:30 +08:00
parent b12ec4bd17
commit 9fd18a1c6b
3 changed files with 53 additions and 59 deletions
+20 -11
View File
@@ -26,7 +26,6 @@ class Act extends Wx {
$a_id = intval($param['a_id']);//活动id
if($this->session['org_id']){
$this->group_id = $this->sylive_entity->get_level($this->session['org_id']);
var_dump($this->group_id);
if($this->group_id<4 && $a_id && !$this->sylive_entity->act_role($this->session['org_id'],$this->group_id,$a_id)){
$this->group_id = 4;
}
@@ -40,6 +39,7 @@ class Act extends Wx {
}
public function index(){
$alert_code = $this->input->get('alert_code');
$skey = $this->input->get('skey');
if (!$skey) {
throw new Hd_exception("参数错误", 400);
@@ -121,6 +121,7 @@ class Act extends Wx {
$wx_info = $this->share_info($row);
$info['is_pay'] = $is_pay ? 1 : 0;
$info['show_code'] = $is_show_code ? 1 : 0;
$info['alert_code'] = $alert_code ? 1 : 0;
$this->data['info'] = $info;
$this->data['sign_package'] = $wx_info['sign_package'];
$this->data['share'] = $wx_info['share'];
@@ -178,6 +179,7 @@ class Act extends Wx {
$param = $this->myencryption->base64url_decode($skey);
$a_id = intval($param['a_id']);//活动id
$action = $this->input->get('action');
$show_code = 0;
if ($s_time && $action == "confirm") {
$add_data['a_id'] = $a_id;
$add_data['openid'] = $this->input->get('openid');
@@ -196,10 +198,13 @@ class Act extends Wx {
//订阅用户加统计
$params = array('a_id' => $a_id, 'uid' => $this->uid,'cf_uid' => $act_user['channelId'], 'kpi' => 'subscribe');
$this->sylive_entity->kpi_log($params);
$p_user = [];
$act_user['channelId'] && $p_user = $this->user_model->get(['userId'=>$act_user['channelId']]);
$p_user['teamId'] && $show_code = 1;
}
}
}
$url = http_host_com('home') . "/h5/market/sylive/act?skey={$skey}";
$url = http_host_com('home') . "/h5/market/sylive/act?skey={$skey}&alert_code={$show_code}";
redirect($url);
}
@@ -254,17 +259,21 @@ class Act extends Wx {
}
}
$user = $this->user_model->get(['userId'=>$this->uid],'uname');
if($this->group_id==3){
$where = [
"organizationId = (select parentId from lc_market_sylive_organization where organizationId={$this->session['org_id']})" => null
];
if($user['organizationId']){
if($this->group_id==3){
$where = [
"organizationId = (select parentId from lc_market_sylive_organization where organizationId={$this->session['org_id']})" => null
];
}else{
$where = [
"organizationId" => $this->session['org_id']
];
}
$biz = $this->market_sylive_organization_model->get($where,'organizationName');
$this->data['posterTip'] = "{$biz['organizationName']}{$user['uname']}诚挚邀请您参与";
}else{
$where = [
"organizationId" => $this->session['org_id']
];
$this->data['posterTip'] = "{$user['nickname']}诚挚邀请您参与";
}
$biz = $this->market_sylive_organization_model->get($where,'organizationName');
$this->data['posterTip'] = "{$biz['organizationName']}{$user['uname']}诚挚邀请您参与";
$this->data['lists'] = $lists;
$this->data['shareTitle'] = $shareTitle;
//微信分享
+28 -46
View File
@@ -76,22 +76,6 @@ class Tstic extends Admin{
$browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'subscribe';
$subscribe_count = $this->mdSytActivityKpiData->count($where); //预约用户
// $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); //顾问
// $cell2 = [
// ['title' => '参与大区', 'num' => "{$area_count['total']}个"],
// ['title' => '参与门店', 'num' => "{$biz_count['total']}家"],
// ['title' => '参与人数', 'num' => "{$gw_count}人"],
// ];
$where = [
'type' => 1,
'a_id' => $a_id,
@@ -116,6 +100,20 @@ class Tstic extends Admin{
$browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'subscribe';
$subscribe_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where = [
'a_id' => $a_id,
'kpi' => 'browse',
'cf_uid' => $this->uid,
'type' => 1
];
$owner_browse_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'subscribe';
$owner_subscribe_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$cell3 = [
['title' => '访问用户', 'num' => "{$owner_browse_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=browse&a_id='.$a_id],
['title' => '预约用户', 'num' => "{$owner_subscribe_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=subscribe&a_id='.$a_id],
['title' => '预约率', 'num' => $owner_browse_count ? round($owner_subscribe_count/$owner_browse_count*100,2)."%" : 0],
];
}
$cell1 = [
['title' => '访问用户', 'num' => "{$browse_count}",'url'=>'/h5/market/sylive/tstic/users?type=all&kpi=browse&a_id='.$a_id],
@@ -170,36 +168,6 @@ class Tstic extends Admin{
$view_count = $this->mdSytActivityKpiData->count($where); //浏览数据
$where['kpi'] = 'order';
$order_count = $this->mdSytActivityKpiData->count($where); //预约用户
// $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); //顾问
// $cell3 = [
// ['title' => '参与大区', 'num' => "{$area_count['total']}个"],
// ['title' => '参与门店', 'num' => "{$biz_count['total']}家"],
// ['title' => '参与人数', 'num' => "{$gw_count}人"],
// ];
$where = [
'type' => 1,
'a_id' => $a_id,
'kpi' => 'watch',
'cf_uid' => $this->uid
];
$owner_view_count = $this->mdSytActivityKpiData->count($where); //观看数据
$where['kpi'] = 'order';
$owner_order_count = $this->mdSytActivityKpiData->count($where); //下单数据
$cell4 = [
['title' => '观看用户', 'num' => "{$owner_view_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=watch&a_id='.$a_id],
['title' => '下单用户', 'num' => "{$owner_order_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=order&a_id='.$a_id],
['title' => '转化率', 'num' => $owner_view_count ? round($owner_order_count/$owner_view_count*100,2)."%" : 0],
];
}else{ //团长
$where = [
'type' => 1,
@@ -227,6 +195,20 @@ class Tstic extends Admin{
'url' => '',
'list' => $view_time_lists['lists']
];
$where = [
'type' => 1,
'a_id' => $a_id,
'kpi' => 'watch',
'cf_uid' => $this->uid
];
$owner_view_count = $this->mdSytActivityKpiData->count($where); //观看数据
$where['kpi'] = 'order';
$owner_order_count = $this->mdSytActivityKpiData->count($where); //下单数据
$cell4 = [
['title' => '观看用户', 'num' => "{$owner_view_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=watch&a_id='.$a_id],
['title' => '下单用户', 'num' => "{$owner_order_count}",'url'=>'/h5/market/sylive/tstic/users?type=owner&kpi=order&a_id='.$a_id],
['title' => '转化率', 'num' => $owner_view_count ? round($owner_order_count/$owner_view_count*100,2)."%" : 0],
];
}
$cell1 = [
['title' => '观看用户', 'num' => "{$view_count}",'url'=>'/h5/market/sylive/tstic/users?type=all&kpi=watch&a_id='.$a_id],
+5 -2
View File
@@ -50,13 +50,13 @@
<div class="mt10">
<span>您的</span><div class="inline-block relative tx-shadow-e5"><span class="relative z-index-1 color-333">50积分</span></div><span>奖励即将到账</span>
</div>
<div class="mt10">添加[东风EV官方企微号]即刻领取</div>
<div class="mt10">添加东风EV官方企微号即刻领取</div>
<div class="mt10">
<span>更有</span><div class="inline-block relative tx-shadow-e5"><span class="relative z-index-1 color-333">100%中奖</span></div><span>惊喜等着您</span>
</div>
</div>
<div class="mt20 pt10 text-center">
<img class='inline-block imgsize-360X360' :src='info.code' />
<img class='inline-block imgsize-360X360' src='https://qs.haodian.cn/web/images/project/H5-ShiYu/df-code.jpg' />
</div>
<div class="pt10 pb20 pl20 pr20 font-24 color-fe9538 line-height-15">
<img class="imgsize-24X24 text-middle" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/df-code.jpg" alt="#" />
@@ -124,6 +124,9 @@
this.bundleIntervalEvent = setInterval(this.intervalEvent, 1000);
this.getInfo()
if(this.info.alert_code){
this.msgisShowCode = true
}
this.getNotice()
},