diff --git a/admin/controllers/receiver/Orders.php b/admin/controllers/receiver/Orders.php index d4e29c62..a65adda6 100644 --- a/admin/controllers/receiver/Orders.php +++ b/admin/controllers/receiver/Orders.php @@ -135,7 +135,9 @@ 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['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['finance_rows'] = $this->sys_finance_model->select(['status' => 1],'',0,0,'id,title'); $loan['finance_rows_nums'] = $this->sys_finance_model->get_nums(); @@ -645,5 +647,38 @@ class Orders extends HD_Controller $this->data['info'] = $info; return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); } - + + public function get_paylog(){ + $this->load->model('app/liche/app_liche_orders_model'); + 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; + $list = []; + $where = [ + 'o_id' => $params['id'], + 'status' => 1, + 'pid>' => 0, + 'total_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'); + $type_arr = $this->app_liche_orders_model->get_type_arr(); + foreach($rows as $item){ + $list[] = [ + 'money' => $item['total_price'], + 'type_cn' => $type_arr[$item['type']], + 'pay_time' => $item['pay_time'] + ]; + } + } + $this->data['list'] = $list; + $hasNext = ceil($count / $size) > $page ? 1 : 0; + $this->data['commonPage'] = array('page' => $page, 'pageLimit' => $size, 'pageCount' => $count, 'hasNext' => $hasNext); + return $this->show_json(SYS_CODE_SUCCESS, '操作成功'); + } + $this->data['id'] = $this->input->get('id'); + return $this->show_view('receiver/orders/paylog'); + } } diff --git a/admin/libraries/OrdersList.php b/admin/libraries/OrdersList.php index bd790848..4c24681a 100644 --- a/admin/libraries/OrdersList.php +++ b/admin/libraries/OrdersList.php @@ -504,11 +504,17 @@ class OrdersList $count = $this->ci->order_loans_model->count_order($where, $t2); $lists = []; if ($count) { + $this->ci->load->model('sys/sys_finance_model'); $fileds = "$t1.o_id,$t1.title,$t1.year,$t1.first_price,$t1.status,$t1.c_time,"; - $fileds .= "$t2.id,$t2.name,$t2.mobile,$t2.sid"; + $fileds .= "$t2.id,$t2.name,$t2.mobile,$t2.sid,$t2.finance_id,$t2.money_json"; $rows = $this->ci->order_loans_model->select_order($where, "$t1.id desc", $page, $size, $fileds); + $finance_arr = array_column($rows,'finance_id'); + $finance_rows = $this->ci->sys_finance_model->get_map_by_ids($finance_arr,'id,title'); foreach ($rows as $key => $val) { - $val['first_price'] = number_format($val['first_price'], 2); + $money_json = json_decode($val['money_json'],true); + $price_loan = $money_json['price_loan'] ? $money_json['price_loan'] : 0; + $val['title'] = $finance_rows[$val['finance_id']] ? $finance_rows[$val['finance_id']][0]['title'] : ''; + $val['price_loan'] = number_format($price_loan, 2); $val['c_time'] = date('Y-m-d H:i:s', $val['c_time']); $val['status_name'] = $status_arr[$val['status']]; $lists[] = $val; diff --git a/admin/views/receiver/order/loan/lists.php b/admin/views/receiver/order/loan/lists.php index 42a1d53e..cd482b54 100644 --- a/admin/views/receiver/order/loan/lists.php +++ b/admin/views/receiver/order/loan/lists.php @@ -213,8 +213,7 @@ 客户姓名 客户电话 分期产品 - 年限 - 首付金额 + 贷款金额 分期时间 状态 操作 @@ -227,8 +226,7 @@ - - + diff --git a/admin/views/receiver/orders/get.php b/admin/views/receiver/orders/get.php index b41a60e7..0966eee2 100644 --- a/admin/views/receiver/orders/get.php +++ b/admin/views/receiver/orders/get.php @@ -254,6 +254,9 @@ 已确认开票 + + 收款记录 + diff --git a/admin/views/receiver/orders/loaninfo.php b/admin/views/receiver/orders/loaninfo.php index 6bf17e1f..6c69f4b6 100644 --- a/admin/views/receiver/orders/loaninfo.php +++ b/admin/views/receiver/orders/loaninfo.php @@ -48,8 +48,8 @@
-
@@ -67,8 +67,9 @@
- + + {{info.loan_info.notify_file_name}} +
@@ -85,10 +86,6 @@ -
- -
已完成按揭
+
+ + {{info.loan_info.lend_file_name}} + +
diff --git a/admin/views/receiver/orders/paylog.php b/admin/views/receiver/orders/paylog.php new file mode 100644 index 00000000..dfddccc6 --- /dev/null +++ b/admin/views/receiver/orders/paylog.php @@ -0,0 +1,79 @@ +
+ +
+ + + + + + + + + + + + + + + +
付款金额类型付款时间
{{item.money}}{{item.type_cn}}{{item.pay_time}}
+
+ 第{{page.page}}页(每页{{page.pageLimit}}条,共{{page.pageCount}}条) + +
+
+
+ diff --git a/api/controllers/wxapp/liche/Pay.php b/api/controllers/wxapp/liche/Pay.php index ae83fe9a..753ce0b7 100644 --- a/api/controllers/wxapp/liche/Pay.php +++ b/api/controllers/wxapp/liche/Pay.php @@ -10,6 +10,7 @@ defined('WXAPP_APP') OR exit('No direct script access allowed'); require_once APPPATH . 'controllers/wxapp/Wxapp.php'; require_once COMMPATH.'libraries/WechatPayV3.php'; class Pay extends Wxapp{ + const MIN_PRICE = 5000; //最低单笔金额 public function __construct($inputs, $app_key){ parent::__construct($inputs, $app_key); @@ -56,6 +57,9 @@ class Pay extends Wxapp{ if($need_pay<=0){ throw new Exception('订单已支付完成无需支付'.$need_pay, API_CODE_FAIL); } + if($price$need_pay){ throw new Exception('输入金额有误,你最高只需支付'.$need_pay, API_CODE_FAIL); }