作者 潘浩文
1 个管道 的构建 通过 耗费 0 秒

1

@@ -20,11 +20,12 @@ class BrandController extends WeChatBaseController @@ -20,11 +20,12 @@ class BrandController extends WeChatBaseController
20 { 20 {
21 parent::_initialize(); 21 parent::_initialize();
22 $this->checkWeChatUserLogin(); 22 $this->checkWeChatUserLogin();
23 - $this->checkUser(); 23 +
24 } 24 }
25 //品牌首页接口 25 //品牌首页接口
26 public function brand() 26 public function brand()
27 { 27 {
  28 + $this->checkUser();
28 // $param=$this->request->param(); 29 // $param=$this->request->param();
29 $where['b.status']=1; 30 $where['b.status']=1;
30 // if (!empty($param['category'])){ 31 // if (!empty($param['category'])){
@@ -90,6 +91,7 @@ class BrandController extends WeChatBaseController @@ -90,6 +91,7 @@ class BrandController extends WeChatBaseController
90 //品牌详情 91 //品牌详情
91 public function brandDetail() 92 public function brandDetail()
92 { 93 {
  94 + $re=$this->checkUser();
93 $id=$this->request->param('id'); 95 $id=$this->request->param('id');
94 $data=Db::name('brand') 96 $data=Db::name('brand')
95 ->alias('b') 97 ->alias('b')
@@ -99,7 +101,7 @@ class BrandController extends WeChatBaseController @@ -99,7 +101,7 @@ class BrandController extends WeChatBaseController
99 ->field('b.*,bc1.name as cname,bc2.name as fname') 101 ->field('b.*,bc1.name as cname,bc2.name as fname')
100 ->find(); 102 ->find();
101 $data['content']=cmf_replace_content_file_url(htmlspecialchars_decode($data['content'])); 103 $data['content']=cmf_replace_content_file_url(htmlspecialchars_decode($data['content']));
102 - $like=Db::name('like')->where(['cid'=>$id,'users_id'=>session('wechat_user')['users_id'],'status'=>1])->find(); 104 + $like=Db::name('like')->where(['cid'=>$id,'users_id'=>$re['id'],'status'=>1])->find();
103 if ($like){ 105 if ($like){
104 $like=1; 106 $like=1;
105 }else{ 107 }else{