edit-api-auto

This commit is contained in:
lccsw
2021-08-23 13:48:04 +08:00
parent f67e786f2c
commit 1ac1bda71f
2 changed files with 52 additions and 4 deletions
+50 -3
View File
@@ -18,14 +18,61 @@ class Series extends Wxapp{
$this->check_status = array();//用户状态校验
$this->check_mobile = array();//需要手机号
$this->check_headimg =array();//授权微信信息
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
}
//获取车系
protected function get(){
$page = $this->input_param('page');
$size = $this->input_param('size');
$brand_id = $this->input_param('brand_id');
!$page && $page = 1;
!$size && $size = 20;
$where = [
'status' => 1
];
$brand_id && $where['brand_id']=$brand_id;
$count = $this->auto_series_model->count($where);
$list = $this->auto_series_model->select($where,'id desc',$page,$size,'id,name');
$data = [
'list' => $list,
'total' => $count
];
return $data;
}
//获取品牌
protected function get_brands(){
$page = $this->input_param('page');
$size = $this->input_param('size');
!$page && $page = 1;
!$size && $size = 20;
$where = [
'status' => 1
];
if($this->session['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;
}
$count = $this->auto_brand_model->count($where);
$list = $this->auto_brand_model->select($where,'id desc',$page,$size,'id,name');
$data = [
'list' => $list,
'total' => $count
];
return $data;
}
//获取车型列表
protected function get_cars(){
$uid = $this->session['uid'];
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model("biz/biz_model");
$id = $this->input_param('id'); //车系id
@@ -40,7 +87,7 @@ class Series extends Wxapp{
$auto_brands = $jsondata['auto_brands'] ? $jsondata['auto_brands'] : [0];
$str_brands = implode(',',$auto_brands);
$where["id in ($str_brands)"] = null;
$where["brand_id in ($str_brands)"] = null;
}
if($id){ //只显示相同品牌
$series = $this->auto_series_model->get(['id'=>$id],'brand_id');
+2 -1
View File
@@ -82,7 +82,8 @@ class Customers extends Wxapp{
$data['baseinfo'] = [
'name' => ['value'=>$row['name'],'cn'=>'客户姓名'],
'mobile' => ['value'=>mobile_asterisk($row['mobile']),'cn'=>'客户电话'],
'car_id' => ['value'=>$row['s_id'],'cn'=>'品牌车型'],
'brand_id' => ['value'=>$row['s_id'],'cn'=>'车辆品牌'],
'car_id' => ['value'=>$row['s_id'],'cn'=>'车辆车系'],
'v_id' => ['value'=>$row['v_id'],'cn'=>'车型级别'],
'color_id' => ['value'=>$car_json['c_id'],'cn'=>'车型颜色'],
'cf_clues' => ['value'=>$row['cf_clues'],'cn'=>'线索来源'],