edit-auto-cars

This commit is contained in:
lccsw
2021-10-28 09:47:39 +08:00
parent adbea9690d
commit cdbe15eb05
14 changed files with 96 additions and 123 deletions
+10 -27
View File
@@ -69,14 +69,8 @@ class Cars extends HD_Controller{
$select = '*';
$rows = $this->auto_cars_model->select($where, $orderby, $page, $size, $select);
if($rows){
$s_ids = array();
$attr_ids = array();
foreach($rows as $v){
!in_array($v['s_id'], $s_ids) && $s_ids[] = $v['s_id'];
$v['v_id'] && !in_array($v['v_id'], $attr_ids) && $attr_ids[] = $v['v_id'];
$v['cor_id'] && !in_array($v['cor_id'], $attr_ids) && $attr_ids[] = $v['cor_id'];
$v['incor_id'] && !in_array($v['incor_id'], $attr_ids) && $attr_ids[] = $v['incor_id'];
}
$s_ids = array_unique(array_column($rows,'s_id'));
$attr_ids = array_unique(array_column($rows,'v_id'));
//获取车系列表
$map_sery = array();
if($s_ids){
@@ -90,22 +84,19 @@ class Cars extends HD_Controller{
$where_attr = array("id in ({$str_ids})" => null);
$map_attr = $this->auto_attr_model->map('id', 'title', $where_attr, 'id desc', 0 , 0, 'id, title, type');
}
//属性按'车型-车身颜色-内饰颜色'排序
foreach($rows as $v){
$attr_title = "{$map_attr[$v['v_id']]}-{$map_attr[$v['cor_id']]}-内饰{$map_attr[$v['incor_id']]}";
$title = "{$map_brand[$v['brand_id']]} {$map_sery[$v['s_id']]} {$attr_title}";
$title = "{$map_brand[$v['brand_id']]} {$map_sery[$v['s_id']]} {$map_attr[$v['v_id']]}";
$lists[] = array(
'id' => $v['id'],
'title' => $title,
'status' => $v['status'],
'price_car' => $v['price_car'] > 0 ? $v['price_car'] : '0.00',
'price_floor' => $v['price_floor'] > 0 ? $v['price_floor'] : '0.00',
'price_book' => $v['price_book'] > 0 ? $v['price_book'] : '0.00',
'price_insure' => $v['price_insure'] > 0 ? $v['price_insure'] : '0.00',
'price_fine' => $v['price_fine'] > 0 ? $v['price_fine'] : '0.00',
'price_finance' => $v['price_finance'] > 0 ? $v['price_finance'] : '0.00',
'first_pay' => $v['first_pay'] > 0 ? $v['first_pay'] : '0.00',
'month_pay' => $v['month_pay'] > 0 ? $v['month_pay'] : '0.00',
'price_coplus' => $v['price_coplus'] > 0 ? $v['price_coplus'] : '0.00',
'brokerage_1' => $v['brokerage_1'] > 0 ? $v['brokerage_1'] : '0.00',
'brokerage_2' => $v['brokerage_2'] > 0 ? $v['brokerage_2'] : '0.00',
@@ -152,12 +143,11 @@ class Cars extends HD_Controller{
'sery_name' => $row_sery['name'],
'attr' => $attr,
'price_car' => $row['price_car'] > 0 ? $row['price_car'] : '',
'price_floor' => $row['price_floor'] > 0 ? $row['price_floor'] : '',
'price_book' => $row['price_book'] > 0 ? $row['price_book'] : '',
'price_insure' => $row['price_insure'] > 0 ? $row['price_insure'] : '',
'price_fine' => $row['price_fine'] > 0 ? $row['price_fine'] : '',
'price_finance' => $row['price_finance'] > 0 ? $row['price_finance'] : '',
'first_pay' => $row['first_pay'] > 0 ? $row['first_pay'] : '',
'month_pay' => $row['month_pay'] > 0 ? $row['month_pay'] : '0.00',
'price_coplus' => $row['price_coplus'] > 0 ? $row['price_coplus'] : '',
'brokerage_1' => $row['brokerage_1'] > 0 ? $row['brokerage_1'] : '',
'brokerage_2' => $row['brokerage_2'] > 0 ? $row['brokerage_2'] : '',
@@ -185,7 +175,7 @@ class Cars extends HD_Controller{
$brand_id = $info['brand_id'];
$s_id = $info['s_id'];
$where = array('s_id' => $s_id);
$where = array('s_id' => $s_id,'type'=>1);
$orderby = 'type asc, id asc';
$select = 'id,type';
$map = $this->auto_attr_model->map('type', '', $where, $orderby, 0, 0, $select);
@@ -214,15 +204,13 @@ class Cars extends HD_Controller{
$rows_car = $this->auto_cars_model->select($where, 'id desc', 0, 0, 'id, v_id, cor_id, incor_id');
$map_cars = array();
foreach($rows_car as $v){
$k = "{$v['cor_id']}_{$v['v_id']}_{$v['incor_id']}";
$k = "{$v['v_id']}";
$map_cars[$k] = $v;
}
$adds = array();
foreach($attrs as $attr){
$cor_id = $attr[0] ? $attr[0] : 0;//0-车身颜色
$v_id = $attr[1] ? $attr[1] : 0;//1-车型
$incor_id = $attr[2] ? $attr[2] : 0;//2-内饰颜色
$k = "{$cor_id}_{$v_id}_{$incor_id}";
$k = "{$v_id}";
if($map_cars[$k]){
$map_cars[$k]['ok'] = 1;//保留
} else {
@@ -230,8 +218,6 @@ class Cars extends HD_Controller{
'brand_id' => $brand_id,
's_id' => $s_id,
'v_id' => $v_id,
'cor_id' => $cor_id,
'incor_id' => $incor_id,
'status' => 1,
'c_time' => time()
);
@@ -273,12 +259,11 @@ class Cars extends HD_Controller{
$upd = array(
'price_car' => floatval($info['price_car']),
'price_floor' => floatval($info['price_floor']),
'price_book' => floatval($info['price_book']),
'price_insure' => floatval($info['price_insure']),
'price_fine' => floatval($info['price_fine']),
'price_finance' => floatval($info['price_finance']),
'first_pay' => floatval($info['first_pay']),
'month_pay' => floatval($info['month_pay']),
'price_coplus' => floatval($info['price_coplus']),
'brokerage_1' => floatval($info['brokerage_1']),
'brokerage_2' => floatval($info['brokerage_2']),
@@ -349,8 +334,6 @@ class Cars extends HD_Controller{
'brand_id' => $brand_id,
's_id' => $s_id,
'v_id' => $v_id,
'cor_id' => $cor_id,
'incor_id' => $incor_id,
);
$row = $this->auto_cars_model->get($where);
@@ -392,4 +375,4 @@ class Cars extends HD_Controller{
exit("total:{$total}; count:{$count}; done:{$done};");
}
}
}
+6 -3
View File
@@ -223,6 +223,7 @@ class Customer extends HD_Controller
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_attr_model');
$row = $this->customers_model->get(array('id' => $id));
if (!$row) {
@@ -231,9 +232,11 @@ class Customer extends HD_Controller
$if_driver = 1 == $row['if_driver'] ? '是' : '否';
$is_top = 1 == $row['is_top'] ? '是' : '否';
$car_json = json_decode($row['car_json'], true);
$side = $car_json['version']['title'] ? $car_json['version']['title'] : '';
$color = $car_json['color']['title'] ? $car_json['color']['title'] : '';
$car_json = json_decode($row['car_json'],true);
$version = $this->auto_attr_model->get(['id'=>$car_json['v_id']],'title');
$color = $this->auto_attr_model->get(['id'=>$car_json['c_id']],'title');
$side = $version ? $version['title'] : '';
$color = $color ? $color['title'] : '';
$row_biz = $this->biz_model->get(array('id' => $row['biz_id']));
$row_brand = $this->auto_brand_model->get(array('id' => $row['brand_id']), 'name');
+8 -15
View File
@@ -6,6 +6,13 @@
<span></span>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">车辆底价:</label>
<div class="am-para-input">
<input type="text" placeholder="请输入车辆底价" name="price_floor" v-model="info.price_floor" style="display: inline;width: 60%"/>
<span></span>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">定金:</label>
<div class="am-para-input">
@@ -34,20 +41,6 @@
<span></span>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">分期首付:</label>
<div class="am-para-input">
<input type="text" placeholder="请输入分期首付" name="first_pay" v-model="info.first_pay" style="display: inline;width: 60%"/>
<span></span>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">月供金额:</label>
<div class="am-para-input">
<input type="text" placeholder="请输入月供金额" name="month_pay" v-model="info.month_pay" style="display: inline;width: 60%"/>
<span></span>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">公司加价:</label>
<div class="am-para-input">
@@ -132,4 +125,4 @@
watch:{}
});
});
</script>
</script>
+7 -10
View File
@@ -49,23 +49,22 @@
<label><input type="checkbox" data-check-target=".ids"></label>
<span>ID</span>
</th>
<th width="7%"><span>裸车报价</span></th>
<th width="9%"><span>裸车报价</span></th>
<th width="7%"><span>车辆底价</span></th>
<th width="7%"><span>定金</span></th>
<th width="7%"><span>保险报价</span></th>
<th width="7%"><span>精品报价</span></th>
<th width="7%"><span>金融报价</span></th>
<th width="7%"><span>分期首付</span></th>
<th width="7%"><span>月供金额</span></th>
<th width="7%"><span>公司加价</span></th>
<th width="10%"><span>一级分销佣金</span></th>
<th width="10%"><span>二级分销佣金</span></th>
<th width="9%"><span>一级分销佣金</span></th>
<th width="9%"><span>二级分销佣金</span></th>
<th width=""><span>操作</span></th>
</tr>
</thead>
<tbody>
<template v-for="(v,i) in lists">
<tr class="tl">
<td colspan="12">车型:<span style="font-weight: 600;color:#FF7F50;">{{v.title}}</span></td>
<td colspan="11">车型:<span style="font-weight: 600;color:#FF7F50;">{{v.title}}</span></td>
</tr>
<tr >
<td>
@@ -74,24 +73,22 @@
</td>
<template v-if="1==v.edit">
<td><input style="width: 100%" type="text" name="price_car" v-model="info_edit.price_car" placeholder=""></td>
<td><input style="width: 100%" type="text" name="price_floor" v-model="info_edit.price_floor" placeholder=""></td>
<td><input style="width: 100%" type="text" name="price_book" v-model="info_edit.price_book" placeholder=""></td>
<td><input style="width: 100%" type="text" name="price_insure" v-model="info_edit.price_insure" placeholder=""></td>
<td><input style="width: 100%" type="text" name="price_fine" v-model="info_edit.price_fine" placeholder=""></td>
<td><input style="width: 100%" type="text" name="price_finance" v-model="info_edit.price_finance" placeholder=""></td>
<td><input style="width: 100%" type="text" name="first_pay" v-model="info_edit.first_pay" placeholder=""></td>
<td><input style="width: 100%" type="text" name="month_pay" v-model="info_edit.month_pay" placeholder=""></td>
<td><input style="width: 100%" type="text" name="price_coplus" v-model="info_edit.price_coplus" placeholder=""></td>
<td><input style="width: 100%" type="text" name="brokerage_1" v-model="info_edit.brokerage_1" placeholder=""></td>
<td><input style="width: 100%" type="text" name="brokerage_2" v-model="info_edit.brokerage_2" placeholder=""></td>
</template>
<template v-else>
<td @dblclick="set_edit(i,1)">{{v.price_car}}</td>
<td @dblclick="set_edit(i,1)">{{v.price_floor}}</td>
<td @dblclick="set_edit(i,1)">{{v.price_book}}</td>
<td @dblclick="set_edit(i,1)">{{v.price_insure}}</td>
<td @dblclick="set_edit(i,1)">{{v.price_fine}}</td>
<td @dblclick="set_edit(i,1)">{{v.price_finance}}</td>
<td @dblclick="set_edit(i,1)">{{v.first_pay}}</td>
<td @dblclick="set_edit(i,1)">{{v.month_pay}}</td>
<td @dblclick="set_edit(i,1)">{{v.price_coplus}}</td>
<td @dblclick="set_edit(i,1)">{{v.brokerage_1}}</td>
<td @dblclick="set_edit(i,1)">{{v.brokerage_2}}</td>
+26 -33
View File
@@ -20,6 +20,8 @@ class Series extends Wxapp{
$this->check_headimg =array();//授权微信信息
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_attr_model');
$this->load->model('auto/auto_cars_model');
$this->load->model("biz/biz_model");
}
//获取车系
@@ -134,41 +136,37 @@ class Series extends Wxapp{
!$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,
'status' => 1
];
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){
$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]){
if($type==2 || $type==1){ //1颜色 2内饰颜色
$type = $type==1 ? 0 : $type;
$where = [
's_id' => $s_id,
'type' => $type,
'status' => 1
];
$count = $this->auto_attr_model->count($where);
$lists = $this->auto_attr_model->select($where,'',$page,$size,'id,title');
}else{ //车辆级别
$where = [
's_id' => $s_id,
'status' => 1
];
$rows = $this->auto_cars_model->select($where,'id desc',$page,$size,'id,s_id,v_id');
if($rows){
$target_arr = array_unique(array_column($rows,'v_id'));
$attrs = $this->auto_attr_model->get_map_by_ids($target_arr,'id,title');
foreach($attrs as $key => $val){
$lists[] = [
'id' => $attr_id,
'title' => $attrs[$attr_id][0]['title']
'id' => $key,
'title' => $val[0]['title']
];
}
}
$count = count($lists);
}
$data = [
'list' => $lists,
'total' => count($lists)
'total' => $count
];
return $data;
}
@@ -177,19 +175,14 @@ class Series extends Wxapp{
protected function get_info(){
$s_id = $this->input_param('car_id');
$v_id = $this->input_param('v_id');
$color_id = $this->input_param('color_id');
$incolor_id = $this->input_param('incolor_id');
$this->load->model('auto/auto_cars_model');
if(!$s_id || !$v_id || !$color_id || !$incolor_id){
if(!$s_id || !$v_id){
throw new Exception('参数错误', ERR_PARAMS_ERROR);
}
$where_car = array(
's_id'=>$s_id,
'v_id' => $v_id,
'cor_id' => $color_id,
'incor_id' => $incolor_id,
'status' => 1
);
$car = $this->auto_cars_model->get($where_car);
+2 -2
View File
@@ -407,9 +407,9 @@ class User extends Wxapp{
foreach($rows as $key=>$val){
$item = $this->items_model->get(['id'=>$val['item_id']],'vin');
$agent = $this->agents_model->get(['o_id'=>$val['id']]);
$color = $this->auto_attr_model->get(['id'=>$val['cor_id']],'title,jsondata');
$color && $color['jsondata'] = json_decode($color['jsondata'],true);
$agent['ins_time'] = $agent['ins_time'] ? date('Y.m.d',strtotime($agent['ins_time'])):'';
$car_json = json_decode($val['car_json'],true);
$color = isset($car_json['color']) ? $car_json['color'] : '';
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$serie_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
+14 -10
View File
@@ -33,7 +33,6 @@ class Cusorder extends Wxapp{
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_attr_model');
$this->load->model('auto/auto_cars_model');
$this->load->model('auto/auto_finance_model');
$this->load->model('apporder/order_purchase_model');
$this->load->model('app/liche/app_liche_orders_model');
@@ -97,7 +96,7 @@ class Cusorder extends Wxapp{
$this->orders_model->update(['status'=>-1],['id'=>$o_order['id']]);
// throw new Exception('该手机号用户存在未完成订单', API_CODE_FAIL);
}
$car_row = $this->auto_cars_model->get(['brand_id'=>$series_row['brand_id'],'s_id'=>$series_row['id'],'v_id'=>$v_id,'cor_id'=>$color_id,'incor_id'=>$incolor_id]);
$car_row = $this->auto_cars_model->get(['brand_id'=>$series_row['brand_id'],'s_id'=>$series_row['id'],'v_id'=>$v_id]);
if(!$car_row){
throw new Exception('参数错误', API_CODE_FAIL);
}
@@ -288,7 +287,7 @@ class Cusorder extends Wxapp{
}else{
strlen($status) && $where['status'] = $status;
}
$fileds = 'id,name,mobile,car_json,brand_id,s_id,deposit,payway,status,c_time';
$fileds = 'id,name,mobile,brand_id,s_id,v_id,cor_id,incor_id,deposit,payway,status,c_time';
$count = $this->orders_model->count($where);
$lists = [];
if($count){
@@ -300,15 +299,19 @@ class Cusorder extends Wxapp{
$series_arr = array_unique(array_column($rows,'s_id'));
$series = $this->auto_series_model->get_map_by_ids($series_arr,'id,name');
//获取车辆属性
$version_arr = array_unique(array_column($rows,'v_id'));
$color_arr = array_unique(array_column($rows,'cor_id'));
$attrs_arr = array_merge($version_arr,$color_arr);
$attrs = $this->auto_attr_model->get_map_by_ids($attrs_arr,'id,title');
$status_arr = $this->orders_model->get_status();
foreach($rows as $key=>$val){
$car_json = json_decode($val['car_json'],true);
$color = isset($car_json['color']) ? $car_json['color']['title'] : '';
$version = isset($car_json['version']) ? $car_json['version']['title'] : '';
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$serie_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$color = isset($attrs[$val['cor_id']]) ? $attrs[$val['cor_id']][0]['title'] : '';
$version = isset($attrs[$val['v_id']]) ? $attrs[$val['v_id']][0]['title'] : '';
$other_data = [
'品牌车型' => "{$brand_name}{$serie_name}-{$color}-{$version}",
@@ -342,9 +345,10 @@ class Cusorder extends Wxapp{
$brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
$series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
$car_json = json_decode($row['car_json'],true);
$color = isset($car_json['color']) ? $car_json['color']['title'] : '';
$version = isset($car_json['version']) ? $car_json['version']['title'] : '';
$color = $this->auto_attr_model->get(['id'=>$row['cor_id']],'title');
$version = $this->auto_attr_model->get(['id'=>$row['v_id']],'title');
$color = $color ? $color['title'] : '';
$version = $version ? $version['title'] : '';
//贷款信息
$loan_data = [];
+1 -1
View File
@@ -130,7 +130,7 @@ class Cusorder2 extends Wxapp{
$row = $this->orders_model->get(['id'=>$id]);
$series_row = $this->auto_series_model->get(['id'=>$car_id]);
$car_row = $this->auto_cars_model->get(['brand_id'=>$series_row['brand_id'],'s_id'=>$series_row['id'],'v_id'=>$v_id,'cor_id'=>$color_id,'incor_id'=>$incolor_id]);
$car_row = $this->auto_cars_model->get(['brand_id'=>$series_row['brand_id'],'s_id'=>$series_row['id'],'v_id'=>$v_id]);
if(!$row || !$series_row || !$car_row){
throw new Exception('参数错误', ERR_PARAMS_ERROR);
}
+1 -1
View File
@@ -70,7 +70,7 @@ class Finance extends Wxapp{
if(!$series_row || !$row){
throw new Exception('参数错误', ERR_PARAMS_ERROR);
}
$car_row = $this->auto_cars_model->get(['brand_id'=>$series_row['brand_id'],'s_id'=>$series_row['id'],'v_id'=>$v_id,'cor_id'=>$color_id,'incor_id'=>$incolor_id],'id,price_car');
$car_row = $this->auto_cars_model->get(['brand_id'=>$series_row['brand_id'],'s_id'=>$series_row['id'],'v_id'=>$v_id],'id,price_car');
$where = [
'car_id' => $car_row['id'],
-2
View File
@@ -29,8 +29,6 @@ class Loan extends Wxapp{
$where_car = array(
's_id'=>$row['s_id'],
'v_id' => $row['v_id'],
'cor_id' => $row['cor_id'],
'incor_id' => $row['incor_id']
);
$car = $this->auto_cars_model->get($where_car,'first_pay');
$money = $car['first_pay'] ? $car['first_pay'] * 36 : 0;
+20 -16
View File
@@ -23,7 +23,6 @@ class Protocol extends CI_Controller{
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_cars_model');
$this->load->model('auto/auto_attr_model');
$this->load->model("biz/biz_model");
@@ -45,10 +44,12 @@ class Protocol extends CI_Controller{
if($row){
$brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
$series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
$car_json = json_decode($row['car_json'],true);
$row['color'] = isset($car_json['color']) ? $car_json['color']['title'] : '';
$row['incolor'] = isset($car_json['incolor']) ? $car_json['incolor']['title'] : '';
$row['version'] = isset($car_json['version']) ? $car_json['version']['title'] : '';
$version = $this->auto_attr_model->get(['id'=>$row['v_id']],'title');
$color = $this->auto_attr_model->get(['id'=>$row['cor_id']],'title');
$incolor = $this->auto_attr_model->get(['id'=>$row['incor_id']],'title');
$row['version'] = $version['title'] ? $version['title'] : '';
$row['color'] = $color['title'] ? $color['title'] : '';
$row['incolor'] = $incolor['title'] ? $incolor['title'] : '';
$row['brand_name'] = $brand['name'];
$row['series_name'] = $series['name'];
//获取门店信息
@@ -114,9 +115,8 @@ class Protocol extends CI_Controller{
if($row){
$brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
$series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
$car_json = json_decode($row['car_json'],true);
$version = isset($car_json['version']) ? $car_json['version']['title'] : '';
$row['brand_name'] = $brand['name'].$series['name'].' '.$version;
$version = $this->auto_attr_model->get(['id'=>$row['v_id']],'title');
$row['brand_name'] = $brand['name'].$series['name'].' '.$version['title'];
//获取门店信息
$biz = $this->biz_model->get(['id'=>$row['biz_id']]);
if($row['brand_id']==4){ //哪吒品牌 公司固定厦门狸车销售公司
@@ -150,12 +150,14 @@ class Protocol extends CI_Controller{
}
$brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
$series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
$car_json = json_decode($row['car_json'],true);
$money_json = json_decode($row['money_json'],true);
$row['info_json'] = $info_json = json_decode($row['info_json'],true);
$row['color'] = isset($car_json['color']) ? $car_json['color']['title'] : '';
$row['incolor'] = isset($car_json['incolor']) ? $car_json['incolor']['title'] : '';
$row['version'] = isset($car_json['version']) ? $car_json['version']['title'] : '';
$version = $this->auto_attr_model->get(['id'=>$row['v_id']],'title');
$color = $this->auto_attr_model->get(['id'=>$row['cor_id']],'title');
$incolor = $this->auto_attr_model->get(['id'=>$row['incor_id']],'title');
$row['version'] = $version['title'] ? $version['title'] : '';
$row['color'] = $color['title'] ? $color['title'] : '';
$row['incolor'] = $incolor['title'] ? $incolor['title'] : '';
$row['brand_name'] = $brand['name'];
$row['series_name'] = $series['name'];
$row['cardid'] = $info_json['cardid'];
@@ -201,10 +203,12 @@ class Protocol extends CI_Controller{
if($row){
$brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
$series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
$car_json = json_decode($row['car_json'],true);
$row['color'] = isset($car_json['color']) ? $car_json['color']['title'] : '';
$row['incolor'] = isset($car_json['incolor']) ? $car_json['incolor']['title'] : '';
$row['version'] = isset($car_json['version']) ? $car_json['version']['title'] : '';
$version = $this->auto_attr_model->get(['id'=>$row['v_id']],'title');
$color = $this->auto_attr_model->get(['id'=>$row['cor_id']],'title');
$incolor = $this->auto_attr_model->get(['id'=>$row['incor_id']],'title');
$row['version'] = $version['title'] ? $version['title'] : '';
$row['color'] = $color['title'] ? $color['title'] : '';
$row['incolor'] = $incolor['title'] ? $incolor['title'] : '';
$row['brand_name'] = $brand['name'];
$row['series_name'] = $series['name'];
//获取门店信息
-2
View File
@@ -54,8 +54,6 @@ class Deal_entity
'brand_id' => $order['brand_id'],
's_id' => $order['s_id'],
'v_id' => $order['v_id'],
'cor_id' => $order['cor_id'],
'incor_id' => $order['incor_id'],
'status' => 1
];
$car = $this->ci->auto_cars_model->get($where);
@@ -28,7 +28,6 @@ class Orders_entity{
$this->ci->load->model('apporder/order_purchase_model');
$this->ci->load->model('auto/auto_brand_model');
$this->ci->load->model('auto/auto_series_model');
$this->ci->load->model('auto/auto_cars_model');
$this->ci->load->model("biz/biz_model");
$this->ci->load->model('app/liche/app_liche_orders_model');
+1
View File
@@ -83,6 +83,7 @@ alter table lc_auto_cars
add column incor_id int unsigned not null default '0' comment '内饰颜色' after cor_id;
alter table lc_auto_cars modify attrs char(30) not null default '' comment '属性组合:{type0id}_{type1id}_{type2id}';
alter table lc_auto_cars drop index attrs;
alter table lc_auto_cars add price_floor double(10,2) not null default '0.00' comment '车辆底价' after price_car;
-- ----------------------------