From 51e3fd272beda1ace67bc2378a2d8d991fa86f8a Mon Sep 17 00:00:00 2001 From: lccsw <805383944@qq.com> Date: Wed, 12 Oct 2022 15:24:03 +0800 Subject: [PATCH] edit-sylive-admin_auth --- home/controllers/h5/market/sylive/Act.php | 2 +- home/controllers/h5/market/sylive/Login.php | 9 ++++++--- home/controllers/h5/market/sylive/Stic.php | 12 +++++++++--- home/views/h5/market/sylive/biz/brands.php | 13 ++++++++----- home/views/h5/market/sylive/biz/index.php | 13 ++++++++----- home/views/h5/market/sylive/biz/lists.php | 13 ++++++++----- home/views/h5/market/sylive/header.php | 2 +- home/views/h5/market/sylive/login.php | 18 +++--------------- home/views/h5/market/sylive/stic/area.php | 9 +++++++-- home/views/h5/market/sylive/stic/index.php | 5 ++++- www/home/css/h5/market/sylive/h5.css | 2 +- 11 files changed, 56 insertions(+), 42 deletions(-) diff --git a/home/controllers/h5/market/sylive/Act.php b/home/controllers/h5/market/sylive/Act.php index aba6cffe..f1e30ffa 100644 --- a/home/controllers/h5/market/sylive/Act.php +++ b/home/controllers/h5/market/sylive/Act.php @@ -45,7 +45,7 @@ class Act extends Wx { $subscribemsg = '已订阅直播'; } else { if(!$user['nickname'] && !$user['headimg']){ - $sub_redirect_url = http_host_com('home')."/h5/market/sylive/act/userinfo?skey={$skey}&type=sub"; + $subscribemsg = http_host_com('home')."/h5/market/sylive/act/userinfo?skey={$skey}&type=sub"; }else{ $this->load->config('wechat'); $config = $this->config->item('liche'); diff --git a/home/controllers/h5/market/sylive/Login.php b/home/controllers/h5/market/sylive/Login.php index 4e1b71ed..29b54c14 100644 --- a/home/controllers/h5/market/sylive/Login.php +++ b/home/controllers/h5/market/sylive/Login.php @@ -9,6 +9,7 @@ class Login extends CI_Controller{ parent::__construct(); session_start(); $this->load->model('market/market_sylive_user_model', 'user_model'); + $this->load->library('hd_exception'); } public function index(){ @@ -24,12 +25,10 @@ class Login extends CI_Controller{ if($user['status']){ $this->show_json('',400,'用户已禁用'); } - $this->bind_openid($user); $_SESSION['market_sylive_session'] = ['uid' => $user['userId'],'org_id'=>$user['organizationId']]; $this->show_json('',200,'登录成功'); }else{ $wx_info = $_SESSION[self::WX_SESSION]; - $data['auth_userinfo'] = false; if($wx_info['nickname'] || $wx_info['headimgurl']){ $data['auth_userinfo'] = true; } @@ -79,6 +78,8 @@ class Login extends CI_Controller{ $this->load->helper('string'); $code = random_string('numeric', 4); $redis->save($key, $code, 60*5); + }else{ + $code = $redis->get($key); } send_sms($mobile, $code); $this->show_json('',200, '验证码已发送'); @@ -97,7 +98,9 @@ class Login extends CI_Controller{ $ret = $this->set_auth('',1); if($ret){ $_SESSION[self::WX_SESSION] = $ret; - $url = http_host_com('home').'/h5/market/sylive/login'; + $user=$this->user_model->get(['userId'=>$_SESSION['market_sylive_session']['uid']]); + $this->bind_openid($user); + $url = http_host_com('home').'/h5/market/sylive'; redirect($url); } } diff --git a/home/controllers/h5/market/sylive/Stic.php b/home/controllers/h5/market/sylive/Stic.php index 6f1d0336..adaead5b 100644 --- a/home/controllers/h5/market/sylive/Stic.php +++ b/home/controllers/h5/market/sylive/Stic.php @@ -22,9 +22,14 @@ class Stic extends Admin{ if($this->group_id>3){ throw new Hd_exception('权限不足',400); } + $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); + } + $info['tab'] = time()>=strtotime($row['timeStart']) ? 2 : 1; if($this->group_id==3){ //顾问 - $param = $this->myencryption->base64url_decode($this->data['skey']); - $a_id = intval($param['a_id']);//活动id $browse_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'browse','cf_uid'=>$this->uid]); $subscribe_count = $this->mdSytActivityKpiData->count(['a_id'=>$a_id,'kpi'=>'subscribe','cf_uid'=>$this->uid]); $info['begin'] = [ @@ -42,6 +47,7 @@ class Stic extends Admin{ $this->data['info'] = $info; $this->show_view('h5/market/sylive/stic/index'); }else{ //门店和大区 + $this->data['info'] = $info; $this->show_view('h5/market/sylive/stic/area'); } } @@ -264,7 +270,7 @@ class Stic extends Admin{ public function event(){ $map_kpi_name = [ - 'browse' => '浏览了直播间', 'subscribe' => '订阅了直播间', 'order' => '直播间下单','watch' => '进入了直播间' + 'browse' => '浏览了活动页', 'subscribe' => '订阅了直播通知', 'order' => '直播间下单','watch' => '进入了直播间' ]; $skey = $this->input->get('skey'); $page = $this->input->get('page'); diff --git a/home/views/h5/market/sylive/biz/brands.php b/home/views/h5/market/sylive/biz/brands.php index 24ef5c12..40e1bb9c 100644 --- a/home/views/h5/market/sylive/biz/brands.php +++ b/home/views/h5/market/sylive/biz/brands.php @@ -50,14 +50,17 @@