From 79002a61cbacf9ac9f25fa6e645f013b36b7d83a Mon Sep 17 00:00:00 2001 From: 潘浩文 <phw@bronet.cn> Date: Fri, 19 Oct 2018 15:33:18 +0800 Subject: [PATCH] 1 --- app/portal/controller/BrandController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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{ -- libgit2 0.24.0