orderve orders export add srv
This commit is contained in:
@@ -658,6 +658,7 @@ class Orders extends HD_Controller
|
||||
$params['page'] = 1;
|
||||
$params['size'] = 10000;
|
||||
$indexs = [];
|
||||
$params['status_pid'] == 5 && $params['status'] = 1;
|
||||
$fieldAry = $this->ordersv2list->get_fields($params['status_pid'], 1);
|
||||
foreach ($fieldAry as $key => $value) {
|
||||
$indexs[$key] = $value['title'];
|
||||
|
||||
@@ -62,6 +62,47 @@ class Ordersv2List
|
||||
return $result;
|
||||
}
|
||||
|
||||
//获取车辆服务费, 参考 \orderv2\Orders.php public function get()
|
||||
private function get_srv_info($row){
|
||||
//获取车辆服务费
|
||||
$srv_info = $this->ci->orders_v2_entity->order_srv_money($row['id'], 2);
|
||||
$fine_title = '';
|
||||
if($row['fines']){
|
||||
$fines = json_decode($row['fines'],true);
|
||||
$split = $fine_title = '';
|
||||
foreach($fines as $key=>$val){
|
||||
$price = $val['price']>0 ? number_format(floatval($val['price']),2) : '赠送';
|
||||
$fine_title .= $split."{$val['txt']}:{$price}";
|
||||
$split = ' ';
|
||||
}
|
||||
}
|
||||
$srv_info['total'] = number_format($srv_info['total'], 2);
|
||||
$srv_detail = "";
|
||||
if ($srv_info['list']) {
|
||||
foreach ($srv_info['list'] as $key => $val) {
|
||||
$d = $srv_detail ? ',' : '';
|
||||
if($val['key']=='price_fine_select' && $fine_title){
|
||||
#$srv_detail .= $d . $val['title'] . ":" . number_format(floatval($val['money']), 2)."<span class='text-success'>[$fine_title]</span>";
|
||||
if ($val['money'] > 0){
|
||||
$srv_detail .= $d . $val['title'] . ":" . number_format(floatval($val['money']), 2)."<span class='text-success'>[$fine_title]</span>";
|
||||
$srv_info[$val['key']] = number_format(floatval($val['money']), 2);
|
||||
}
|
||||
else{
|
||||
$srv_detail .= $d . $val['title'] ."<span class='text-success'>[$fine_title]</span>";
|
||||
$srv_info[$val['key']] = '';
|
||||
}
|
||||
$srv_info[$val['key'].'_detail'] = $fine_title;
|
||||
}else{
|
||||
$srv_detail .= $d . $val['title'] . ":" . number_format(floatval($val['money']), 2);
|
||||
$srv_info[$val['key']] = $val['money'] > 0 ? number_format(floatval($val['money']), 2) : '';
|
||||
}
|
||||
}
|
||||
}
|
||||
$srv_info['fine_title'] = $fine_title;
|
||||
$srv_info['detail'] = $srv_detail;
|
||||
return $srv_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:全部订单
|
||||
* Created on: 2021/9/18 15:13
|
||||
@@ -227,7 +268,7 @@ class Ordersv2List
|
||||
$where["{$this->t1}.item_id in(select id from lc_items where vin like '%{$params['vin']}%')"] = null;
|
||||
}
|
||||
$fileds = "{$this->t1}.id,{$this->t1}.name,{$this->t1}.mobile,{$this->t1}.brand_id,{$this->t1}.s_id,{$this->t1}.v_id,
|
||||
{$this->t1}.cor_id,{$this->t1}.incor_id,{$this->t1}.money_json,{$this->t1}.payway,{$this->t1}.status,{$this->t1}.c_time,
|
||||
{$this->t1}.cor_id,{$this->t1}.incor_id,{$this->t1}.money_json,{$this->t1}.payway,{$this->t1}.status,{$this->t1}.c_time,{$this->t1}.fines,
|
||||
{$this->t1}.biz_id,{$this->t1}.bill_time,{$this->t1}.customer_id,{$this->t1}.owner_name,{$this->t1}.owner_mobile,{$this->t1}.main_type,{$this->t1}.info_json,
|
||||
{$this->t1}.order_time,{$this->t1}.bill_time,{$this->t1}.item_id,{$this->t1}.over_time,{$this->t1}.sale_id,{$this->t1}.finance_id,{$this->t1}.refund_time,
|
||||
{$this->t1}.ck_time,{$this->t1}.admin_id";
|
||||
@@ -436,6 +477,12 @@ class Ordersv2List
|
||||
$fields['price_loan'] = $money_json['price_loan'];
|
||||
$fields['is_sure'] = $is_sure ? '是':'否';
|
||||
}
|
||||
$srv_info = $this->get_srv_info($val);
|
||||
$fields['srv_info_total'] = $srv_info['total'] > 0 ? $srv_info['total'] : '';
|
||||
$fields['srv_info_fee_carno'] = $srv_info['fee_carno'] ? $srv_info['fee_carno'] : '';
|
||||
$fields['srv_info_price_finance'] = $srv_info['price_finance'] ? $srv_info['price_finance'] : '';
|
||||
$fields['srv_info_price_fine_select'] = $srv_info['price_fine_select'] ? $srv_info['price_fine_select'] : '';
|
||||
$fields['srv_info_price_fine_select_detail'] = $srv_info['price_fine_select_detail'] ? $srv_info['price_fine_select_detail'] : '';
|
||||
$lists[] = $fields;
|
||||
}
|
||||
}
|
||||
@@ -660,6 +707,11 @@ class Ordersv2List
|
||||
$fields['price_loan'] = ['title'=>'贷款金额'];
|
||||
$fields['is_sure'] = ['title'=>'确认到款(是/否)'];
|
||||
$fields['price_car'] = ['title'=>'最终售价'];
|
||||
$fields['srv_info_total'] = ['title'=>'服务费'];
|
||||
$fields['srv_info_fee_carno'] = ['title'=>'服务-上牌'];
|
||||
$fields['srv_info_price_finance'] = ['title'=>'服务-金融'];
|
||||
$fields['srv_info_price_fine_select'] = ['title'=>'服务-精品选装'];
|
||||
$fields['srv_info_price_fine_select_detail'] = ['title'=>'精品选装内容'];
|
||||
!$fields['c_time'] && $fields['c_time'] = ['title' => '订单时间'];
|
||||
!$fields['over_time'] && $fields['over_time'] = ['title' => '止交付时间'];
|
||||
!$fields['order_time'] && $fields['order_time'] = ['title' => '下定时间'];
|
||||
|
||||
@@ -168,6 +168,9 @@ class Orders_v2_entity{
|
||||
if(!$this->order_row){
|
||||
$this->order_row = $this->ci->receiver_orders_v2_model->get(['id'=>$oid]);
|
||||
}
|
||||
elseif ($this->order_row['id'] != $oid){
|
||||
$this->order_row = $this->ci->receiver_orders_v2_model->get(['id'=>$oid]);
|
||||
}
|
||||
$money_json = json_decode($this->order_row['money_json'],true);
|
||||
$srv_price = 0;
|
||||
$list = []; //明细
|
||||
|
||||
Reference in New Issue
Block a user