diff --git a/app/portal/controller/BrandController.php b/app/portal/controller/BrandController.php index 8c5226b..9fcce54 100644 --- a/app/portal/controller/BrandController.php +++ b/app/portal/controller/BrandController.php @@ -20,11 +20,12 @@ class BrandController extends WeChatBaseController { parent::_initialize(); $this->checkWeChatUserLogin(); - $this->checkUser(); + } //品牌首页接口 public function brand() { + $this->checkUser(); // $param=$this->request->param(); $where['b.status']=1; // if (!empty($param['category'])){ @@ -90,6 +91,7 @@ class BrandController extends WeChatBaseController //品牌详情 public function brandDetail() { + $re=$this->checkUser(); $id=$this->request->param('id'); $data=Db::name('brand') ->alias('b') @@ -99,7 +101,7 @@ class BrandController extends WeChatBaseController ->field('b.*,bc1.name as cname,bc2.name as fname') ->find(); $data['content']=cmf_replace_content_file_url(htmlspecialchars_decode($data['content'])); - $like=Db::name('like')->where(['cid'=>$id,'users_id'=>session('wechat_user')['users_id'],'status'=>1])->find(); + $like=Db::name('like')->where(['cid'=>$id,'users_id'=>$re['id'],'status'=>1])->find(); if ($like){ $like=1; }else{