diff --git a/admin/controllers/receiver/Orders.php b/admin/controllers/receiver/Orders.php index 3aa591cf..cbd7a53c 100644 --- a/admin/controllers/receiver/Orders.php +++ b/admin/controllers/receiver/Orders.php @@ -142,20 +142,20 @@ class Orders extends HD_Controller $loan['status'] = intval($loan['status']); $loan['notify_file'] = $loan['notify_file'] ? build_qiniu_image_url($loan['notify_file']) : ''; - $loan['notify_file_name'] = $loan['notify_file'] ? end(explode('/',$loan['notify_file'])) : ''; + $loan['notify_file_name'] = $loan['notify_file'] ? end(explode('/', $loan['notify_file'])) : ''; $loan['lend_file'] = $loan['lend_file'] ? build_qiniu_image_url($loan['lend_file']) : ''; - $loan['lend_file_name'] = $loan['lend_file'] ? end(explode('/',$loan['lend_file'])) : ''; + $loan['lend_file_name'] = $loan['lend_file'] ? end(explode('/', $loan['lend_file'])) : ''; $loan['finance_rows'] = $this->sys_finance_model->select(['status' => 1], '', 0, 0, 'id,title'); $loan['finance_rows_nums'] = $this->sys_finance_model->get_nums(); $loan['price_loan'] = $money_json['price_loan'] ? $money_json['price_loan'] : ''; $loan['first_pay'] = 0; - if($money_json['price_loan']){ + if ($money_json['price_loan']) { $srv_money = $this->orders_entity->order_srv_money($row['id']); - if($srv_money>$row['deposit']){ - $loan['first_pay'] = $money_json['price_car']-$money_json['price_loan']; - }else{ - $loan['first_pay'] = $money_json['price_car']-$money_json['price_loan']-$row['deposit']; + if ($srv_money > $row['deposit']) { + $loan['first_pay'] = $money_json['price_car'] - $money_json['price_loan']; + } else { + $loan['first_pay'] = $money_json['price_car'] - $money_json['price_loan'] - $row['deposit']; } } !$loan['num'] && $loan['num'] = 12; @@ -593,10 +593,10 @@ class Orders extends HD_Controller } $agent = $this->order_agents_model->get(['o_id' => $row['id']]); $update = []; - $params['car_num'] && $update['car_num'] = $params['car_num']; - $params['e_time'] && $update['ins_time'] = date('Y-m-d H:i:s', strtotime($params['e_time'])); - $params['car_img'] && $update['car_img'] = $params['car_img']; - $update['if_ins'] = $params['if_ins'] ? 1 : 0; + $update['car_num'] = $params['car_num']; + $update['ins_time'] = $params['ins_time'] ? date('Y-m-d H:i:s', strtotime($params['ins_time'])) : '0000-00-00 00:00:00'; + $update['car_img'] = $params['car_img']; + $update['if_ins'] = $params['ins_risk'] ? 1 : 0; $jsondata['if_listed_db'] = intval($params['if_listed_db']); $jsondata['if_ins_db'] = intval($params['if_ins_db']); @@ -668,9 +668,11 @@ class Orders extends HD_Controller $this->data['info'] = $info; return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); } - //支付列表 - public function get_paylog(){ - if($_SERVER['REQUEST_METHOD'] == 'POST'){ + + //支付列表 + public function get_paylog() + { + if ($_SERVER['REQUEST_METHOD'] == 'POST') { $params = $this->input->post(); $page = $params['page'] = $params['page'] ? intval($params['page']) : 1; $size = $params['size'] = $params['size'] ? intval($params['size']) : 10; @@ -678,13 +680,13 @@ class Orders extends HD_Controller $where = [ 'o_id' => $params['id'], 'status' => 1, - 'pay_price>' => 0 + 'pay_price>' => 0 ]; $count = $this->app_liche_orders_model->count($where); - if($count){ - $rows = $this->app_liche_orders_model->select($where,'id desc',$page,$size,'id,total_price,type,pay_time'); + if ($count) { + $rows = $this->app_liche_orders_model->select($where, 'id desc', $page, $size, 'id,total_price,type,pay_time'); $type_arr = $this->app_liche_orders_model->get_type_arr(); - foreach($rows as $item){ + foreach ($rows as $item) { $list[] = [ 'money' => $item['total_price'], 'type_cn' => $type_arr[$item['type']], @@ -700,18 +702,20 @@ class Orders extends HD_Controller $this->data['id'] = $this->input->get('id'); return $this->show_view('receiver/orders/paylog'); } + //添加支付日志 - public function add_paylog(){ - if($this->input->method()=='post'){ + public function add_paylog() + { + if ($this->input->method() == 'post') { $id = $this->input->post('id'); - $row = $this->orders_model->get(['id'=>$id]); + $row = $this->orders_model->get(['id' => $id]); $money = $this->input->post('money'); $pay_time = $this->input->post('pay_time'); - if(!$money || !$pay_time ||!$row){ + if (!$money || !$pay_time || !$row) { return $this->show_json(SYS_CODE_FAIL, '参数错误'); } $this->load->helper('order'); - $sid = create_order_no(350200,'liche',1,5); + $sid = create_order_no(350200, 'liche', 1, 5); $data = [ 'o_id' => $row['id'], 'sid' => $sid, @@ -724,11 +728,11 @@ class Orders extends HD_Controller 'pay_price' => $money, 'type' => 5, 'status' => 1, - 'pay_time' => date('Y-m-d H:i:s',strtotime($pay_time)), + 'pay_time' => date('Y-m-d H:i:s', strtotime($pay_time)), 'c_time' => time() ]; $res = $this->app_liche_orders_model->add($data); - if(!$res){ + if (!$res) { return $this->show_json(SYS_CODE_FAIL, '保存失败'); } return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); diff --git a/admin/views/receiver/orders/agentinfo.php b/admin/views/receiver/orders/agentinfo.php index 16625cff..249b864b 100644 --- a/admin/views/receiver/orders/agentinfo.php +++ b/admin/views/receiver/orders/agentinfo.php @@ -11,7 +11,7 @@
-
@@ -34,7 +34,7 @@
-
@@ -57,7 +57,7 @@
-
@@ -69,14 +69,14 @@
-
-
diff --git a/admin/views/receiver/orders/get.php b/admin/views/receiver/orders/get.php index 0966eee2..f17414ea 100644 --- a/admin/views/receiver/orders/get.php +++ b/admin/views/receiver/orders/get.php @@ -277,6 +277,10 @@ elem: '#loan_time' , type: 'date' }); + laydate.render({ + elem: '#ins_time' + , type: 'date' + }); }); var vue_obj; $(document).ready(function () {