From 4e37d7c0302f81369953d69db412e321e3b77593 Mon Sep 17 00:00:00 2001 From: lccsw <805383944@qq.com> Date: Mon, 6 Jun 2022 16:01:36 +0800 Subject: [PATCH] edit-api-add_over_time --- admin/controllers/receiver/orderv2/Orders.php | 24 +++++++++++++++++++ admin/libraries/Ordersv2List.php | 4 ++-- admin/views/receiver/orderv2/get/paylog.php | 7 ++++++ api/controllers/wxapp/licheb/CusorderV2.php | 6 +++-- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/admin/controllers/receiver/orderv2/Orders.php b/admin/controllers/receiver/orderv2/Orders.php index 1fac92b0..ae10d43e 100644 --- a/admin/controllers/receiver/orderv2/Orders.php +++ b/admin/controllers/receiver/orderv2/Orders.php @@ -708,6 +708,30 @@ class Orders extends HD_Controller $this->data['list'] = $list; $hasNext = ceil($count / $size) > $page ? 1 : 0; $this->data['commonPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext); + + $car_info = [ + 'vin' => '' + ]; + $row = $this->receiver_orders_v2_model->get(['id' => $params['id']]); + $car_info['name'] = $row['owner_name']; + //获取车信息 + $brand = $this->auto_brand_model->get(['id' => $row['brand_id']], 'name'); + $serie = $this->auto_series_model->get(['id' => $row['s_id']], 'name'); + $row['brand_name'] = $brand['name']; + $row['s_name'] = $serie['name']; + $attr_arr = [$row['v_id'], $row['cor_id'], $row['incor_id']]; + $attr = $this->auto_attr_model->get_map_by_ids($attr_arr, 'id,title'); + $row['v_name'] = isset($attr[$row['v_id']]) ? $attr[$row['v_id']][0]['title'] : ''; + $row['cor_name'] = isset($attr[$row['cor_id']]) ? $attr[$row['cor_id']][0]['title'] : ''; + $row['incor_name'] = isset($attr[$row['incor_id']]) ? $attr[$row['incor_id']][0]['title'] : ''; + $car_info['car'] = "{$row['brand_name']}-{$row['s_name']}-{$row['v_name']}-{$row['incor_name']}"; + //获取选择车辆vin + if ($row['item_id']) { + $this->load->model('items/items_model', 'mdItems'); + $row_goods = $this->mdItems->get(array('id' => $row['item_id'])); + $car_info['vin'] = $row_goods['vin']; + } + $this->data['car_info'] = $car_info; return $this->show_json(SYS_CODE_SUCCESS, '操作成功'); } $this->data['id'] = $this->input->get('id'); diff --git a/admin/libraries/Ordersv2List.php b/admin/libraries/Ordersv2List.php index d453ef1a..eca730d1 100644 --- a/admin/libraries/Ordersv2List.php +++ b/admin/libraries/Ordersv2List.php @@ -323,8 +323,8 @@ class Ordersv2List $fields['name'] = $size > 1000 ? $val['name'] : '' . $val['name'] . $o_tp . '
' . $val['mobile'] . '
'; } - $fields['id_card'] = $info_json['c_owner_cardid'] ? $info_json['c_owner_cardid'].'\t' : ''; - $fields['mobile'] = $size > 1000 ? $mobile.'\t' : $mobile; + $fields['id_card'] = $info_json['c_owner_cardid'] ? '\t'.$info_json['c_owner_cardid'] : ''; + $fields['mobile'] = $size > 1000 ? '\t'.$mobile : $mobile; $fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}"; $fields['price_car'] = number_format($money_json['price_car'],2); $fields['payway_name'] = $this->paywayAry[$val['payway']]; diff --git a/admin/views/receiver/orderv2/get/paylog.php b/admin/views/receiver/orderv2/get/paylog.php index 2c51999c..8292e6ce 100644 --- a/admin/views/receiver/orderv2/get/paylog.php +++ b/admin/views/receiver/orderv2/get/paylog.php @@ -1,4 +1,9 @@
+
+ 车主: {{car_info.name}}    + 车型: {{car_info.car}}    + 车架号: {{car_info.vin}} +
添加收款记录
@@ -60,6 +65,7 @@ list:[], pay_price: '', need_price: '', + car_info : [], }, mounted: function () { this.getData(1); @@ -73,6 +79,7 @@ that.page = result.data.commonPage; that.pay_price = result.data.pay_price; that.need_price = result.data.need_price; + that.car_info = result.data.car_info; } }); }, diff --git a/api/controllers/wxapp/licheb/CusorderV2.php b/api/controllers/wxapp/licheb/CusorderV2.php index cd9e5678..b054c597 100644 --- a/api/controllers/wxapp/licheb/CusorderV2.php +++ b/api/controllers/wxapp/licheb/CusorderV2.php @@ -674,7 +674,8 @@ class CusorderV2 extends Wxapp{ $where["order_time >="] = date('Y-m-d 00:00:00',strtotime($order_s_time)); $where["order_time <="] = date('Y-m-d 00:00:00',strtotime($order_e_time)); } - $fileds = 'id,customer_id,name,mobile,brand_id,s_id,v_id,cor_id,incor_id,payway,status,c_time,money_json,if_num,info_json,main_type,owner_name,owner_mobile,item_id'; + $fileds = 'id,customer_id,name,mobile,brand_id,s_id,v_id,cor_id,incor_id,payway, + status,c_time,money_json,if_num,info_json,main_type,owner_name,owner_mobile,item_id,order_time,over_time'; $count = $this->orders_model->count($where); $lists = []; if ($count) { @@ -787,7 +788,8 @@ class CusorderV2 extends Wxapp{ $other_data['交车合照'] = ['type' => 'text', 'value' => $img_status['other_img']['text'], 'bg_color' => $img_status['other_img']['color']]; $other_data['交付'] = ['type' => 'checkbox', 'value' => '', 'lists' => $ck_status, 'bg_color' => '']; } - $other_data['订单日期'] = ['type' => 'text', 'value' => date('Y-m-d', $val['c_time']), 'bg_color' => '']; + $val['order_time']!='0000-00-00 00:00:00' && $other_data['下定时间'] = ['type' => 'text', 'value' => date('Y-m-d', strtotime($val['order_time'])), 'bg_color' => '']; + $val['over_time']!='0000-00-00 00:00:00' && $other_data['截止交付'] = ['type' => 'text', 'value' => date('Y-m-d', strtotime($val['over_time'])), 'bg_color' => '']; } else { $price_intention = $money_json['price_intention'] ? $money_json['price_intention'] : ''; $other_data = [