...
|
...
|
@@ -26,7 +26,6 @@ class BrandController extends WeChatBaseController |
|
|
//品牌首页接口
|
|
|
public function brand()
|
|
|
{
|
|
|
$this->checkUser();
|
|
|
// $param=$this->request->param();
|
|
|
$where['b.status'] = 1;
|
|
|
// if (!empty($param['category'])){
|
...
|
...
|
@@ -94,7 +93,13 @@ class BrandController extends WeChatBaseController |
|
|
//品牌详情
|
|
|
public function brandDetail()
|
|
|
{
|
|
|
$re = $this->checkUser();
|
|
|
$re=Db::name('users')->where(['open_id'=>session('wechat_user')['id']])->find();
|
|
|
if (!$re['mobile']){
|
|
|
$like=0;
|
|
|
}else{
|
|
|
return $re;
|
|
|
}
|
|
|
|
|
|
$id = $this->request->param('id');
|
|
|
$data = Db::name('brand')
|
|
|
->alias('b')
|
...
|
...
|
@@ -104,11 +109,13 @@ 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' => $re['id'], 'status' => 1])->find();
|
|
|
if ($like) {
|
|
|
$like = 1;
|
|
|
} else {
|
|
|
$like = 0;
|
|
|
if (!isset($like)) {
|
|
|
$like = Db::name('like')->where(['cid' => $id, 'users_id' => $re['id'], 'status' => 1])->find();
|
|
|
if ($like) {
|
|
|
$like = 1;
|
|
|
} else {
|
|
|
$like = 0;
|
|
|
}
|
|
|
}
|
|
|
$comment = Db::name('comment')
|
|
|
->alias('c')
|
...
|
...
|
@@ -126,7 +133,6 @@ class BrandController extends WeChatBaseController |
|
|
//品牌评论页面
|
|
|
public function comment()
|
|
|
{
|
|
|
$this->checkUser();
|
|
|
$id = $this->request->param('id');
|
|
|
$this->assign('id', $id);
|
|
|
return $this->fetch();
|
...
|
...
|
|