diff --git a/api/controllers/wxapp/app/Series.php b/api/controllers/wxapp/app/Series.php index f725e9ff..809a601e 100644 --- a/api/controllers/wxapp/app/Series.php +++ b/api/controllers/wxapp/app/Series.php @@ -128,32 +128,47 @@ class Series extends Wxapp{ $type = $this->input_param('type'); $page = $this->input_param('page'); $size = $this->input_param('size'); + $v_id = $this->input_param('v_id'); + $cor_id = $this->input_param('color_id'); !$page && $page = 1; !$size && $size = 20; + $this->load->model('auto/auto_cars_model'); $this->load->model('auto/auto_attr_model'); $where = [ - 's_id' => $s_id + 's_id' => $s_id, + 'status' => 1 ]; - strlen($type) && $where['type'] = $type; - $count = $this->auto_attr_model->count($where); - $rows = $this->auto_attr_model->select($where,'id desc',$page,$size,'id,title,type,jsondata'); + if($type==2){ //内饰颜色 + $where['v_id'] = $v_id; + $where['cor_id'] = $cor_id; + $groupby = "incor_id"; + }elseif($type==1){ //颜色 + $where['v_id'] = $v_id; + $groupby = "cor_id"; + }else{ //车辆级别 + $groupby = "v_id"; + } $lists = []; + $rows = $this->auto_cars_model->select_groupby($groupby,$where,'',$page,$size,'id,s_id,v_id,cor_id,incor_id'); if($rows){ - foreach($rows as $key=>$val){ - $jsodnata = json_decode($val['jsondata'],true); - $temp = [ - 'id' => $val['id'], - 'title' => $val['title'] - ]; - $lists[] = $temp; + $target_arr = array_column($rows,$groupby); + $attrs = $this->auto_attr_model->get_map_by_ids($target_arr,'id,title'); + foreach($rows as $key => $val){ + $attr_id = $val[$groupby]; + if($attrs[$attr_id]){ + $lists[] = [ + 'id' => $attr_id, + 'title' => $attrs[$attr_id][0]['title'] + ]; + } } } $data = [ 'list' => $lists, - 'total' => $count + 'total' => count($lists) ]; return $data; } @@ -174,9 +189,13 @@ class Series extends Wxapp{ 's_id'=>$s_id, 'v_id' => $v_id, 'cor_id' => $color_id, - 'incor_id' => $incolor_id + 'incor_id' => $incolor_id, + 'status' => 1 ); $car = $this->auto_cars_model->get($where_car); + if(!$car){ + throw new Exception('当前车型暂无库存', ERR_PARAMS_ERROR); + } $data = [ 'price' => $car['price_car'] ? $car['price_car'] : 0, 'deposit' => $car['price_book'] ? $car['price_book'] : 0 diff --git a/api/controllers/wxapp/licheb/Cusorder.php b/api/controllers/wxapp/licheb/Cusorder.php index d8c742bf..38276de6 100644 --- a/api/controllers/wxapp/licheb/Cusorder.php +++ b/api/controllers/wxapp/licheb/Cusorder.php @@ -238,16 +238,10 @@ class Cusorder extends Wxapp{ //订单列表头部 protected function get_tabs(){ - $rows = $this->orders_model->get_status(); - $lists = []; - if($rows){ - foreach($rows as $key=>$val){ - $lists[] = [ - 'key' => $key, - 'name' => $val - ]; - } - } + $lists = [ + ['key' =>0 ,'name' => '进行中'], + ['key' =>1 ,'name' => '已完成'], + ]; return $lists; } @@ -260,7 +254,6 @@ class Cusorder extends Wxapp{ $biz_id = $this->session['new_biz_id'] ? $this->session['new_biz_id'] : intval($this->session['biz_id']); $keyword = $this->input_param('keyword'); $status = $this->input_param('status'); - //$ismy = $this->input_param('ismy'); //是否只显示自己 $page = $this->input_param('page'); $size = $this->input_param('size'); @@ -276,7 +269,12 @@ class Cusorder extends Wxapp{ if($keyword){ $where["(name='{$keyword}' or mobile='{$keyword}')"] = null; } - strlen($status) && $where['status'] = $status; + if($status){ //已完成 + $where['status'] = 6; + }else{ //进行中 + $where['status>='] = 0; + $where['status!='] = 6; + } $fileds = 'id,name,mobile,car_json,brand_id,s_id,deposit,payway,status,c_time'; $count = $this->orders_model->count($where); $lists = []; @@ -290,6 +288,7 @@ class Cusorder extends Wxapp{ $series = $this->auto_series_model->get_map_by_ids($series_arr,'id,name'); $status_arr = $this->orders_model->get_status(); + $this->load->library('receiver/orders_entity'); foreach($rows as $key=>$val){ $car_json = json_decode($val['car_json'],true); @@ -312,6 +311,7 @@ class Cusorder extends Wxapp{ 'mobile' => mobile_asterisk($val['mobile']), 'status_name' => $status_arr[$val['status']], 'other_data' => $other_data, + 'remark' => $this->orders_entity->get_remark($val['status']) ]; } } diff --git a/api/views/wxapp/licheb/html2pdf/agent.php b/api/views/wxapp/licheb/html2pdf/agent.php index 9edd5ce4..98c6bb4a 100644 --- a/api/views/wxapp/licheb/html2pdf/agent.php +++ b/api/views/wxapp/licheb/html2pdf/agent.php @@ -64,7 +64,7 @@
日期:
-
乙方(
+
乙方(
日期:
diff --git a/api/views/wxapp/licheb/html2pdf/car.php b/api/views/wxapp/licheb/html2pdf/car.php index d2b20511..6d5e3f48 100644 --- a/api/views/wxapp/licheb/html2pdf/car.php +++ b/api/views/wxapp/licheb/html2pdf/car.php @@ -120,7 +120,7 @@
日期:
-
乙方(
+
乙方(
日期:
diff --git a/api/views/wxapp/licheb/html2pdf/car_ck.php b/api/views/wxapp/licheb/html2pdf/car_ck.php index d000c9bf..05abbdf9 100644 --- a/api/views/wxapp/licheb/html2pdf/car_ck.php +++ b/api/views/wxapp/licheb/html2pdf/car_ck.php @@ -28,7 +28,7 @@
日期:
-
乙方(
+
乙方(
日期:
diff --git a/api/views/wxapp/licheb/html2pdf/car_fh.php b/api/views/wxapp/licheb/html2pdf/car_fh.php index e5d87ebf..57ba46fc 100644 --- a/api/views/wxapp/licheb/html2pdf/car_fh.php +++ b/api/views/wxapp/licheb/html2pdf/car_fh.php @@ -76,7 +76,7 @@
日期:
-
乙方(
+
乙方(
日期:
diff --git a/api/views/wxapp/licheb/protocol/agent.php b/api/views/wxapp/licheb/protocol/agent.php index ba372648..cb5d42c7 100644 --- a/api/views/wxapp/licheb/protocol/agent.php +++ b/api/views/wxapp/licheb/protocol/agent.php @@ -45,7 +45,7 @@
日期:
-
乙方(
+
乙方(
日期:
diff --git a/api/views/wxapp/licheb/protocol/car.php b/api/views/wxapp/licheb/protocol/car.php index 8083ca82..0ca67ec9 100644 --- a/api/views/wxapp/licheb/protocol/car.php +++ b/api/views/wxapp/licheb/protocol/car.php @@ -124,7 +124,7 @@
日期:
-
乙方(
+
乙方(
日期:
diff --git a/api/views/wxapp/licheb/protocol/car_ck.php b/api/views/wxapp/licheb/protocol/car_ck.php index 644f34e4..11521a29 100644 --- a/api/views/wxapp/licheb/protocol/car_ck.php +++ b/api/views/wxapp/licheb/protocol/car_ck.php @@ -32,7 +32,7 @@
日期:
-
乙方(
+
乙方(
日期:
diff --git a/api/views/wxapp/licheb/protocol/car_fh.php b/api/views/wxapp/licheb/protocol/car_fh.php index c106588c..8eb125d6 100644 --- a/api/views/wxapp/licheb/protocol/car_fh.php +++ b/api/views/wxapp/licheb/protocol/car_fh.php @@ -80,7 +80,7 @@
日期:
-
乙方(
+
乙方(
日期:
diff --git a/common/libraries/receiver/Orders_entity.php b/common/libraries/receiver/Orders_entity.php index 5b4e0bbe..3fe0442d 100644 --- a/common/libraries/receiver/Orders_entity.php +++ b/common/libraries/receiver/Orders_entity.php @@ -634,6 +634,21 @@ class Orders_entity{ } return $res; } + /** + * 根据订单状态获取备注 + * @param $status int 状态值 + */ + public function get_remark($status){ + $config = [ + 0 => '点击“邀请签名”,提醒客户签字并缴交定金', + 1 => '分期业务会线下拉群,暂时无需操作', + 2 => '需要提醒客户去狸车小程序确认车辆并签名', + 3 => '需要上传客户身份证/营业执照', + 4 => '整理上牌资料、国补资料发给客服', + 5 => '客户提完车,需要点击“确认交付”' + ]; + return $config[$status] ? $config[$status] : ''; + } } ?>