edit-admin-export_order
This commit is contained in:
@@ -402,6 +402,7 @@ class Orders extends HD_Controller
|
||||
$params['size'] = 10000;
|
||||
$indexs = [];
|
||||
if ($params['export_type']) {
|
||||
echo 'ee';exit;
|
||||
$result = $this->orderslist->export_data($params['status_pid'], $params);
|
||||
$fileName = '保险明细';
|
||||
$data = $result['data'];
|
||||
|
||||
@@ -13,6 +13,7 @@ class Bill extends HD_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->library('OrdersList');
|
||||
$this->load->model('items/items_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -70,12 +71,24 @@ class Bill extends HD_Controller
|
||||
$indexs = $result['indexs'];
|
||||
}else{
|
||||
$fieldAry = $this->orderslist->get_fields($this->status_pid, 1);
|
||||
$fieldAry['bill_time']['title'] = '开票时间';
|
||||
$fieldAry['vin']['title'] = '车架号';
|
||||
foreach ($fieldAry as $key => $value) {
|
||||
$indexs[$key] = $value['title'];
|
||||
}
|
||||
$result = $this->orderslist->lists($this->status_pid, $params);
|
||||
$item_arr_ids = array_unique(array_column($result['lists'],'item_id'));
|
||||
$item_map = [];
|
||||
if($item_arr_ids){
|
||||
$str_ids = implode(',',$item_arr_ids);
|
||||
$where = [
|
||||
"id in ({$str_ids})" => null
|
||||
];
|
||||
$item_map = $this->items_model->map('id','vin',$where,'','','','id,vin');
|
||||
}
|
||||
$fileName = $result['_title'];
|
||||
foreach ($result['lists'] as $key => $value) {
|
||||
$value['vin'] = $item_map[$value['item_id']];
|
||||
$temp = array();
|
||||
foreach ($fieldAry as $key2 => $value2) {
|
||||
$temp[$key2] = $value[$key2];
|
||||
|
||||
@@ -1016,7 +1016,7 @@ class OrdersList
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$fileds = "$t1.o_id,$t1.status,$t1.c_time,";
|
||||
$fileds .= "$t2.rid,$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.biz_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time,$t2.bill_time";
|
||||
$fileds .= "$t2.rid,$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.biz_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time,$t2.bill_time,$t2.item_id";
|
||||
$rows = $this->ci->order_bills_model->select_order($where, "$t2.c_time desc", $page, $size, $fileds);
|
||||
//客户来源
|
||||
$str_rids = implode(',', array_unique(array_column($rows, 'rid')));
|
||||
@@ -1071,6 +1071,7 @@ class OrdersList
|
||||
$cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'].'(线上)<br>';
|
||||
$customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'].'(线下)';
|
||||
$fields['cf_name'] = $cf_name;
|
||||
$fields['item_id'] = $val['item_id'];
|
||||
$lists[] = $fields;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user