diff --git a/api/controllers/wxapp/material/Home.php b/api/controllers/wxapp/material/Home.php index c99f04c4..88a88351 100644 --- a/api/controllers/wxapp/material/Home.php +++ b/api/controllers/wxapp/material/Home.php @@ -44,19 +44,17 @@ class Home extends Wxapp if ($distribute == 1) {//分销 $res = $this->mdAutoBrand->select(array('status' => 1, 'id<>' => 3), "id desc", 0, 0, 'id,name'); } else { - $res = $this->mdAutoBrand->select(['id' => 1], "id desc", 0, 0, 'id,name');//临时只显示东风品牌 1.19 - //临时隐藏 -// if ($this->biz_id) {//查找门店授权品牌 -// $re_b = $this->mdBiz->get(array('id' => $this->biz_id, 'status' => 1)); -// if ($re_b['jsondata']) { -// $jsondata = json_decode($re_b['jsondata'], true); -// if ($jsondata['auto_brands']) { -// $brand_ids = implode($jsondata['auto_brands'], ','); -// !$brand_ids && $brand_ids = $jsondata['auto_brands']; -// $res = $this->mdAutoBrand->select(array("id in ({$brand_ids})" => null, 'status' => 1, 'id<>' => 3), "id desc", 0, 0, 'id,name'); -// } -// } -// } + if ($this->biz_id) {//查找门店授权品牌 + $re_b = $this->mdBiz->get(array('id' => $this->biz_id, 'status' => 1)); + if ($re_b['jsondata']) { + $jsondata = json_decode($re_b['jsondata'], true); + if ($jsondata['auto_brands']) { + $brand_ids = implode($jsondata['auto_brands'], ','); + !$brand_ids && $brand_ids = $jsondata['auto_brands']; + $res = $this->mdAutoBrand->select(array("id in ({$brand_ids})" => null, 'status' => 1, 'id<>' => 3), "id desc", 0, 0, 'id,name'); + } + } + } } //根据品牌做分类 if ($res) { @@ -74,7 +72,7 @@ class Home extends Wxapp array_multisort($timeKey, SORT_DESC, $list);//排序,根据$total 排序 } } - $distribute == 1 && $list[] = ['id' => '3', 'name' => '狸车'];//全品牌蓄客 $distribute == 1临时加分销判断 1.19 + $list[] = ['id' => '3', 'name' => '狸车'];//全品牌蓄客 $this->data['title'] = '推广素材'; $this->data['list'] = $list; $this->data['list_type'] = [['id' => 4, 'name' => '图片'], ['id' => 1, 'name' => '视频']];