diff --git a/home/controllers/h5/market/sylive/Act.php b/home/controllers/h5/market/sylive/Act.php index 68c3a137..a65d0a27 100644 --- a/home/controllers/h5/market/sylive/Act.php +++ b/home/controllers/h5/market/sylive/Act.php @@ -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; //微信分享 diff --git a/home/controllers/h5/market/sylive/Tstic.php b/home/controllers/h5/market/sylive/Tstic.php index caf1d799..2aa4c43e 100644 --- a/home/controllers/h5/market/sylive/Tstic.php +++ b/home/controllers/h5/market/sylive/Tstic.php @@ -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], diff --git a/home/views/h5/market/sylive/act/index.php b/home/views/h5/market/sylive/act/index.php index 122cb1c0..2ec03c17 100644 --- a/home/views/h5/market/sylive/act/index.php +++ b/home/views/h5/market/sylive/act/index.php @@ -50,13 +50,13 @@
@@ -124,6 +124,9 @@
this.bundleIntervalEvent = setInterval(this.intervalEvent, 1000);
this.getInfo()
+ if(this.info.alert_code){
+ this.msgisShowCode = true
+ }
this.getNotice()
},