edit-admin-loan_order
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -213,8 +213,7 @@
|
||||
<th width="15%"><span>客户姓名</span></th>
|
||||
<th width="12%"><span>客户电话</span></th>
|
||||
<th width="15%"><span>分期产品</span></th>
|
||||
<th width="10%"><span>年限</span></th>
|
||||
<th width="10%"><span>首付金额</span></th>
|
||||
<th width="10%"><span>贷款金额</span></th>
|
||||
<th width="15%"><span>分期时间</span></th>
|
||||
<th width="10%"><span>状态</span></th>
|
||||
<th width=""><span>操作</span></th>
|
||||
@@ -227,8 +226,7 @@
|
||||
<td><?= $v['name'] ?></td>
|
||||
<td><?= $v['mobile'] ?></td>
|
||||
<td><?= $v['title'] ?></td>
|
||||
<td><?= $v['year'] ?></td>
|
||||
<td><?= $v['first_price'] ?></td>
|
||||
<td><?= $v['price_loan'] ?></td>
|
||||
<td><?= $v['c_time'] ?></td>
|
||||
<td><?= $v['status_name'] ?></td>
|
||||
<td>
|
||||
|
||||
@@ -254,6 +254,9 @@
|
||||
</a>
|
||||
<span class='am-btn am-btn-default am-active am-btn-xs' v-else>已确认开票</span>
|
||||
</template>
|
||||
<a class='am-btn am-btn-default am-btn-xs' data-modal="/receiver/orders/get_paylog?id=<?=$info['id']?>" data-title="收款记录">
|
||||
收款记录
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">放款时间:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-label">
|
||||
<input id="loan_time" v-model="info.loan_info.loan_time">
|
||||
<label class="am-para-label">
|
||||
<input type="text" id="loan_time" v-model="info.loan_info.loan_time">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,8 +67,9 @@
|
||||
</label>
|
||||
</div>
|
||||
<div class="am-form-group ml10" v-if="info.loan_info.notify_file">
|
||||
<a :href="info.loan_info.notify_file" target="_blank" class='mt5' title="查看文件"><img
|
||||
src="/img/pdf.png"></a>
|
||||
<a :href="info.loan_info.notify_file" target="_blank" class='mt5' title="查看文件">
|
||||
{{info.loan_info.notify_file_name}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,10 +86,6 @@
|
||||
<input type="file" style="display: none;" accept=".pdf" @change="upTz(1,$event)"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="am-form-group ml10" v-if="info.loan_info.lend_file">
|
||||
<a :href="info.loan_info.lend_file" target="_blank" class='mt5' title="查看文件"><img
|
||||
src="/img/pdf.png"></a>
|
||||
</div>
|
||||
</template>
|
||||
<div class="am-form-group ml10">
|
||||
<a v-if="info.loan_info.status==0" href='javascript:;' @click="finish_loan(1)"
|
||||
@@ -100,6 +97,11 @@
|
||||
<a v-else-if="info.loan_info.status==3" href="javascript:"
|
||||
class="am-btn am-btn-default am-active am-btn-xs">已完成按揭</a>
|
||||
</div>
|
||||
<div class="am-form-group ml10" v-if="info.loan_info.lend_file">
|
||||
<a :href="info.loan_info.lend_file" target="_blank" class='mt5' title="查看文件">
|
||||
{{info.loan_info.lend_file_name}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<div class="coms-table-wrap mt10" id="paylog_content" style="min-height:400px;overflow:hidden">
|
||||
|
||||
<div class="">
|
||||
<table class="am-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>付款金额</th>
|
||||
<th>类型</th>
|
||||
<th>付款时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in list">
|
||||
<td>{{item.money}}</td>
|
||||
<td>{{item.type_cn}}</td>
|
||||
<td>{{item.pay_time}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="clearfix" v-if="page">
|
||||
<span class="pull-left text-muted">第{{page.page}}页(每页{{page.pageLimit}}条,共{{page.pageCount}}条)</span>
|
||||
<nav class="pull-right mr10" aria-label="Page navigation">
|
||||
<ul class="pagination pagination-sm">
|
||||
<li>
|
||||
<a href="javascript:void(0);" @click="beforePage();" aria-label="上一页">
|
||||
<span class="glyphicon glyphicon-menu-left"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li v-if="page.hasNext">
|
||||
<a href="javascript:void(0);" @click="afterPage();" aria-label="下一页">
|
||||
<span class="glyphicon glyphicon-menu-right"></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '#paylog_content',
|
||||
data:{
|
||||
id:<?=$id?$id:''?>,
|
||||
page: [],
|
||||
list:[]
|
||||
},
|
||||
mounted: function () {
|
||||
this.getData(1);
|
||||
},
|
||||
methods: {
|
||||
getData: function(page){
|
||||
var that = this;
|
||||
$.post('/receiver/orders/get_paylog',{id:that.id,page:page},function(result){
|
||||
if(result.code){
|
||||
that.list = result.data.list;
|
||||
that.page = result.data.commonPage;
|
||||
}
|
||||
});
|
||||
},
|
||||
beforePage: function () {
|
||||
var vm = this;
|
||||
if (vm.page.page == 1) {
|
||||
layer.msg('已经是第一页了');
|
||||
return;
|
||||
}
|
||||
vm.page.page--;
|
||||
vm.getData(vm.page.page);
|
||||
},
|
||||
afterPage: function () {
|
||||
var vm = this;
|
||||
vm.page.page++;
|
||||
vm.getData(vm.page.page);
|
||||
},
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@@ -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<self::MIN_PRICE){
|
||||
throw new Exception('单笔金额不得低于'.self::MIN_PRICE, API_CODE_FAIL);
|
||||
}
|
||||
if($price>$need_pay){
|
||||
throw new Exception('输入金额有误,你最高只需支付'.$need_pay, API_CODE_FAIL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user