diff --git a/home/controllers/h5/market/sylive/Act.php b/home/controllers/h5/market/sylive/Act.php index e0e3344a..53f5a2d6 100644 --- a/home/controllers/h5/market/sylive/Act.php +++ b/home/controllers/h5/market/sylive/Act.php @@ -73,7 +73,11 @@ class Act extends Wx { $info['org_id'] = $this->session['org_id']; $info['subscribemsg'] = $subscribemsg; $info['code'] = ''; - $info['shareurl'] = '/h5/market/sylive/act/share?skey='.$info['skey']; + if($this->group_id<4){ + $info['shareurl'] = '/h5/market/sylive/act/share?skey='.$info['skey']; + }else{ + $info['shareurl'] = ''; + } $info['statisticsurl'] = '/h5/market/sylive/stic?skey='.$info['skey']; $info['channelImg'] = build_qiniu_image_url($row['channelImg']); // $info['live_url'] = 'https://live.liche.cn/watch/'.$row['channelId']; diff --git a/home/controllers/h5/market/sylive/Biz.php b/home/controllers/h5/market/sylive/Biz.php index 93066c3e..a3e8b01b 100644 --- a/home/controllers/h5/market/sylive/Biz.php +++ b/home/controllers/h5/market/sylive/Biz.php @@ -35,6 +35,9 @@ class Biz extends Admin { $row = $this->market_sylive_organization_model->get(['organizationId'=>$biz_id]); $this->data['headimg'] = $this->liche_img; $this->data['biz_name'] = $row['organizationName']; + //微信分享 + $wx_info = $this->share_info(); + $this->data['sign_package'] = $wx_info['sign_package']; $this->show_view('h5/market/sylive/biz/index'); } @@ -46,6 +49,9 @@ class Biz extends Admin { $area_id = $this->input->get('area_id'); $this->data['area_id'] = $area_id; $this->data['group_id'] = $this->group_id; + //微信分享 + $wx_info = $this->share_info(); + $this->data['sign_package'] = $wx_info['sign_package']; $this->show_view('h5/market/sylive/biz/lists'); } //大区列表 @@ -53,6 +59,9 @@ class Biz extends Admin { if($this->group_id!=0){ throw new Hd_exception('权限不足',400); } + //微信分享 + $wx_info = $this->share_info(); + $this->data['sign_package'] = $wx_info['sign_package']; $this->show_view('h5/market/sylive/biz/brands'); } //顾问 @@ -60,6 +69,9 @@ class Biz extends Admin { if($this->group_id!=3){ throw new Hd_exception('权限不足',400); } + //微信分享 + $wx_info = $this->share_info(); + $this->data['sign_package'] = $wx_info['sign_package']; $this->show_view('h5/market/sylive/biz/detail'); } public function nav(){ diff --git a/home/controllers/h5/market/sylive/Common.php b/home/controllers/h5/market/sylive/Common.php index e9dae793..c1d8d45b 100644 --- a/home/controllers/h5/market/sylive/Common.php +++ b/home/controllers/h5/market/sylive/Common.php @@ -95,21 +95,24 @@ abstract class Common extends CI_Controller{ } } //微信分享信息 - public function share_info($act_row){ + public function share_info($act_row=[]){ $a_id = $act_row['activityId']; $share_skey = "a_id=" . $a_id . "&cf_uid=" . $this->uid . "&cf_share=" . $this->myencryption->random_string(6); - //微信分享 - $share_url = http_host_com('home') . "/h5/market/sylive/act?skey=" . $this->myencryption->base64url_encode($share_skey); $this->load->library('Jssdk'); $jssdk = new Jssdk('liche'); - $shareTitle = $act_row['shareTitle'] ? json_decode($act_row['shareTitle'],true) : []; $sign_package = $jssdk->getSignPackage(); - $share = array( - 'title' => $act_row['title'], - "img" => $act_row['sharePhoto'] ? build_qiniu_image_url($act_row['sharePhoto']) : '', - "desc" => $shareTitle[array_rand($shareTitle)], - "url" => $share_url - ); + $share = []; + if($act_row){ + //微信分享 + $share_url = http_host_com('home') . "/h5/market/sylive/act?skey=" . $this->myencryption->base64url_encode($share_skey); + $shareTitle = $act_row['shareTitle'] ? json_decode($act_row['shareTitle'],true) : []; + $share = array( + 'title' => $act_row['title'], + "img" => $act_row['sharePhoto'] ? build_qiniu_image_url($act_row['sharePhoto']) : '', + "desc" => $shareTitle[array_rand($shareTitle)], + "url" => $share_url + ); + } return ['sign_package' => $sign_package ,'share' => $share]; } } diff --git a/home/controllers/h5/market/sylive/Stic.php b/home/controllers/h5/market/sylive/Stic.php index 101c62fb..c86a3e4a 100644 --- a/home/controllers/h5/market/sylive/Stic.php +++ b/home/controllers/h5/market/sylive/Stic.php @@ -288,14 +288,21 @@ class Stic extends Admin{ ]; $skey = $this->input->get('skey'); $page = $this->input->get('page'); + $type = $this->input->get('type'); !$page && $page=1; $param = $this->myencryption->base64url_decode($skey); $a_id = intval($param['a_id']);//活动id + $row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]); $where = [ 'a_id'=>$a_id, // 'kpi'=>'watch', 'cf_uid'=>$this->uid ]; + if($type==1){ //预热 + $where['c_time<='] = strtotime($row['timeStart']); + }else{ //开始 + $where['c_time>='] = strtotime($row['timeStart']); + } $total = $this->mdSytActivityKpiData->count($where); $lists = []; if($total){ diff --git a/home/views/h5/market/sylive/act/index.php b/home/views/h5/market/sylive/act/index.php index e1445fad..5a7ded8a 100644 --- a/home/views/h5/market/sylive/act/index.php +++ b/home/views/h5/market/sylive/act/index.php @@ -1,6 +1,5 @@ -
diff --git a/home/views/h5/market/sylive/biz/brands.php b/home/views/h5/market/sylive/biz/brands.php index 40e1bb9c..df05ee1f 100644 --- a/home/views/h5/market/sylive/biz/brands.php +++ b/home/views/h5/market/sylive/biz/brands.php @@ -216,4 +216,5 @@ }, }) +load->view('h5/market/sylive/share_script')?> \ No newline at end of file diff --git a/home/views/h5/market/sylive/biz/index.php b/home/views/h5/market/sylive/biz/index.php index 704ef2d5..3f95c2f4 100644 --- a/home/views/h5/market/sylive/biz/index.php +++ b/home/views/h5/market/sylive/biz/index.php @@ -131,5 +131,5 @@ }, }) - +load->view('h5/market/sylive/share_script')?> \ No newline at end of file diff --git a/home/views/h5/market/sylive/biz/lists.php b/home/views/h5/market/sylive/biz/lists.php index f151d337..21796d27 100644 --- a/home/views/h5/market/sylive/biz/lists.php +++ b/home/views/h5/market/sylive/biz/lists.php @@ -224,5 +224,5 @@ }, }) - +load->view('h5/market/sylive/share_script')?> \ No newline at end of file diff --git a/home/views/h5/market/sylive/header.php b/home/views/h5/market/sylive/header.php index 7e93608b..192f9717 100644 --- a/home/views/h5/market/sylive/header.php +++ b/home/views/h5/market/sylive/header.php @@ -14,4 +14,5 @@ + \ No newline at end of file diff --git a/home/views/h5/market/sylive/hidden_wx_share.php b/home/views/h5/market/sylive/hidden_wx_share.php new file mode 100644 index 00000000..e0527a8a --- /dev/null +++ b/home/views/h5/market/sylive/hidden_wx_share.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/home/views/h5/market/sylive/stic/index.php b/home/views/h5/market/sylive/stic/index.php index 15c72eea..5a65dc99 100644 --- a/home/views/h5/market/sylive/stic/index.php +++ b/home/views/h5/market/sylive/stic/index.php @@ -209,7 +209,7 @@ if (!that.isNoData && !that.isDataEnd && !that.loading) { that.loading = true; //请求接口 - $.get('/h5/market/sylive/stic/event',{'skey':'','page':that.page},function (res){ + $.get('/h5/market/sylive/stic/event',{'skey':'','page':that.page,'type':that.tabid},function (res){ that.loading = false; that.page = that.page + 1; that.dynamic.title = '实时动态';