edit-admin-export_order
This commit is contained in:
@@ -26,6 +26,7 @@ class Ordersv2List
|
||||
$this->ci->load->model('auto/auto_brand_model');
|
||||
$this->ci->load->model('auto/auto_attr_model');
|
||||
$this->ci->load->model('items/items_model', 'mdItems');
|
||||
$this->ci->load->model('area_model');
|
||||
|
||||
$this->ci->load->library('receiver/orders_v2_entity');
|
||||
$this->ci->load->library('receiver/orders_status_entity');
|
||||
@@ -272,7 +273,17 @@ class Ordersv2List
|
||||
//门店
|
||||
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
|
||||
!$str_biz_ids && $str_biz_ids = 0;
|
||||
$bizs = $this->ci->biz_model->map('id', 'biz_name', array("id in({$str_biz_ids})" => null));
|
||||
$bizs_rows = $this->ci->biz_model->select(array("id in({$str_biz_ids})" => null),'','','','id,biz_name,city_id,county_id,type');
|
||||
$bizs = [];
|
||||
if($bizs_rows){ //获取城市
|
||||
$ids = array_unique(array_column($bizs_rows, 'county_id'));
|
||||
$city_rows = $this->ci->area_model->get_map_by_county_ids($ids,'id,city_name,city_id','city_id');
|
||||
foreach ($bizs_rows as $val) {
|
||||
$val['city_name'] = $city_rows[$val['city_id']] ? $city_rows[$val['city_id']][0]['city_name'] : '';
|
||||
$bizs[$val['id']] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
//品牌车型
|
||||
$brand_arr = array_unique(array_column($rows, 'brand_id'));
|
||||
$brands = $this->ci->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
|
||||
@@ -314,8 +325,9 @@ class Ordersv2List
|
||||
}
|
||||
$fields['mobile'] = $mobile;
|
||||
$fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
|
||||
$fields['price'] = $this->paywayAry[$val['payway']]."<br>".number_format($money_json['price_car'], 2);
|
||||
$fields['price_car'] = number_format($money_json['price_car'],2);
|
||||
$fields['payway_name'] = $this->paywayAry[$val['payway']];
|
||||
$fields['price'] = $fields['payway_name']."<br>".$fields['price_car'];
|
||||
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
|
||||
|
||||
if($val['status']==2 || $val['id']<= Orders_v2_entity::V2_START_ID){
|
||||
@@ -326,7 +338,9 @@ class Ordersv2List
|
||||
!$status_name && $status_name = '未下定';
|
||||
}
|
||||
$fields['status_name'] = $status_name;
|
||||
$fields['biz_name'] = $bizs[$val['biz_id']];
|
||||
$fields['biz_name'] = $bizs[$val['biz_id']] ? $bizs[$val['biz_id']]['biz_name'] : '';
|
||||
$fields['city_name'] = $bizs[$val['biz_id']] ? $bizs[$val['biz_id']]['city_name'] : '';
|
||||
$fields['biz_type'] = $bizs[$val['biz_id']] ? $this->ci->biz_model->type_ary($bizs[$val['biz_id']]['type']) : '';
|
||||
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
|
||||
$of_title = '-';
|
||||
$of_id = $customers[$val['customer_id']]['of_id'];
|
||||
@@ -534,7 +548,15 @@ class Ordersv2List
|
||||
}
|
||||
$fields = array_merge($fields1, $fields2);
|
||||
if ($export) {
|
||||
unset($fields['price'],$fields['c_time']);
|
||||
$fields['payway_name'] = ['title'=>'付款方式'];
|
||||
$fields['price_car'] = ['title'=>'最终售价'];
|
||||
$fields['city_name'] = ['title'=>'城市'];
|
||||
$fields['biz_type'] = ['title'=>'门店类型'];
|
||||
$fields['vin'] = ['title' => 'vin码'];
|
||||
$fields['over_time'] = ['title' => '止交付时间'];
|
||||
$fields['order_time'] = ['title' => '下定时间'];
|
||||
$fields['bill_time'] = ['title' => '开票时间'];
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user