edit-api-auto-series
This commit is contained in:
@@ -23,8 +23,7 @@ class Series extends Wxapp{
|
||||
|
||||
//获取车型列表
|
||||
protected function get_cars(){
|
||||
$biz_id = $this->session['biz_id'];
|
||||
|
||||
$uid = $this->session['uid'];
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
@@ -33,12 +32,16 @@ class Series extends Wxapp{
|
||||
$where = [
|
||||
'status' => 1
|
||||
];
|
||||
$biz = $this->biz_model->get(['id'=>$biz_id],'jsondata');
|
||||
$jsondata = json_decode($biz['jsondata'],true);
|
||||
$auto_brands = $jsondata['auto_brands'] ? $jsondata['auto_brands'] : [0];
|
||||
$user = $this->app_user_model->get(array('id' => $uid));
|
||||
if(isset($user['biz_id'])){
|
||||
$biz_id = $this->session['biz_id'];
|
||||
$biz = $this->biz_model->get(['id'=>$biz_id],'jsondata');
|
||||
$jsondata = json_decode($biz['jsondata'],true);
|
||||
$auto_brands = $jsondata['auto_brands'] ? $jsondata['auto_brands'] : [0];
|
||||
|
||||
$str_brands = implode(',',$auto_brands);
|
||||
$where["id in ($str_brands)"] = null;
|
||||
$str_brands = implode(',',$auto_brands);
|
||||
$where["id in ($str_brands)"] = null;
|
||||
}
|
||||
|
||||
$rows = $this->auto_series_model-> select($where,'',1,20,'id,brand_id,name');
|
||||
$list = [];
|
||||
|
||||
Reference in New Issue
Block a user