loan add is_tiexi about
This commit is contained in:
@@ -617,6 +617,7 @@ class Cost extends HD_Controller{
|
||||
'payway_name' => $order['payway_name'],
|
||||
|
||||
'loan_product' => $srv_json['loan_product'],
|
||||
'loan_is_tiexi' => $srv_json['loan_is_tiexi'] ? '是' : '否',
|
||||
'loan_price' => $srv_json['loan_price'],
|
||||
'loan_num' => $srv_json['loan_num'],
|
||||
'loan_srv_price' => $srv_json['loan_srv_price'],
|
||||
@@ -650,7 +651,7 @@ class Cost extends HD_Controller{
|
||||
'promotion_sale_price' => array('title'=>'促销成本', 'column_num'=>3),
|
||||
'business_product' => array('title'=>'保险收入', 'column_num'=>9),
|
||||
'fee_carno' => array('title'=>'挂牌收入', 'column_num'=>3),
|
||||
'loan_product' => array('title'=>'分期付款业务', 'column_num'=>10),
|
||||
'loan_product' => array('title'=>'分期付款业务', 'column_num'=>11),
|
||||
'other_in_price' => array('title'=>'其他收入及成本', 'column_num'=>3),
|
||||
'need_price' => array('title'=>'收款核对', 'column_num'=>3),
|
||||
];
|
||||
@@ -711,6 +712,7 @@ class Cost extends HD_Controller{
|
||||
'payway_name' => '购车方式',
|
||||
|
||||
'loan_product' => '按揭银行',
|
||||
'loan_is_tiexi' => '贴息',
|
||||
'loan_price' => '按揭金额',
|
||||
'loan_num' => '期数',
|
||||
'loan_srv_price' => '按揭服务费',
|
||||
|
||||
@@ -441,6 +441,7 @@ class Orders extends HD_Controller
|
||||
$loan['first_pay'] = $sale_price - $money_json['price_loan'];
|
||||
}
|
||||
!$loan['num'] && $loan['num'] = 36;
|
||||
$loan['is_tiexi'] = intval($loan['is_tiexi']);
|
||||
$loan['loan_time'] = $loan['loan_time'] != '0000-00-00 00:00:00' ? date('Y-m-d', strtotime($loan['loan_time'])) : '';
|
||||
$status_array = $this->receiver_order_status_model->select(['o_id'=>$row['id'],'pid_status'=>1],'','','id,status');
|
||||
$loan['status_array'] = array_column($status_array,'status');
|
||||
|
||||
@@ -411,8 +411,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
<label class="am-para-label label-width"><span class="span-bold"> </span></label>
|
||||
<label class="am-para-label label-width"><span class="span-bold"> 贴息:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con" v-if="info.srv_json.loan_is_tiexi==1">是</label>
|
||||
<label class="am-para-label-con" v-else>否</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
|
||||
@@ -52,6 +52,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
<label class="am-para-label label-width"><span class="span-bold">贴息:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con" v-if="info.loan_info.is_tiexi==1">是</label>
|
||||
<label class="am-para-label-con" v-else>否</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
<label class="am-para-label label-width"><span class="span-bold">期数:</span></label>
|
||||
|
||||
@@ -872,6 +872,7 @@ class Order extends CI_Controller{
|
||||
}
|
||||
$finance_id = $item['finance_id'];
|
||||
$srv_json['loan_product'] = '';
|
||||
$srv_json['loan_is_tiexi'] = $loan_row['is_tiexi'];
|
||||
if ($finance_id){
|
||||
//$finance_row = $this->sys_finance_model->get(array('id'=>$finance_id),'title');
|
||||
$finance_row = $this->sys_supplier_model->get(array('id'=>$finance_id),'title');
|
||||
@@ -890,43 +891,52 @@ class Order extends CI_Controller{
|
||||
echo "<br><br>";
|
||||
}
|
||||
|
||||
/*$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'type' => 3,
|
||||
's_effect_time' => $bill_time_month,
|
||||
"json_extract(jsondata, '$.finance_id') = '{$finance_id}'" => null,
|
||||
"json_extract(jsondata, '$.finance_num') = '{$finance_num}'" => null,
|
||||
];*/
|
||||
$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'type' => 3,
|
||||
'status' => 1,
|
||||
's_effect_time<=' => date('Y-m-d',strtotime($item['bill_time'])),
|
||||
"JSON_UNQUOTE(json_extract(jsondata, '$.supplier_id')) = '{$finance_id}'" => null,
|
||||
"JSON_UNQUOTE(json_extract(jsondata, '$.finance_num')) = '{$finance_num}'" => null,
|
||||
];
|
||||
$fd_row = $this->biz_settle_srv_model->get($where);
|
||||
if ($debug){
|
||||
echo "get 贷款配置 : <br>";
|
||||
echo $this->biz_settle_srv_model->db->last_query()."<br>";
|
||||
var_dump($fd_row);
|
||||
echo "<br><br>";
|
||||
}
|
||||
if(!$fd_row){
|
||||
$fd_row = $this->biz_settle_srv_model->get(['biz_id'=>$item['biz_id'],'is_def'=>1,'status'=>1,'type'=>3,
|
||||
"JSON_UNQUOTE(json_extract(jsondata, '$.supplier_id')) = '{$finance_id}'" => null, "JSON_UNQUOTE(json_extract(jsondata, '$.finance_num')) = '{$finance_num}'" => null]);
|
||||
$profix_loan = $loan_fd = 0;
|
||||
if (!$loan_row['is_tiexi']){
|
||||
/*$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'type' => 3,
|
||||
's_effect_time' => $bill_time_month,
|
||||
"json_extract(jsondata, '$.finance_id') = '{$finance_id}'" => null,
|
||||
"json_extract(jsondata, '$.finance_num') = '{$finance_num}'" => null,
|
||||
];*/
|
||||
$where = [
|
||||
'biz_id' => $item['biz_id'],
|
||||
'type' => 3,
|
||||
'status' => 1,
|
||||
's_effect_time<=' => date('Y-m-d',strtotime($item['bill_time'])),
|
||||
"JSON_UNQUOTE(json_extract(jsondata, '$.supplier_id')) = '{$finance_id}'" => null,
|
||||
"JSON_UNQUOTE(json_extract(jsondata, '$.finance_num')) = '{$finance_num}'" => null,
|
||||
"JSON_UNQUOTE(json_extract(jsondata, '$.rebate')) > 0" => null,
|
||||
];
|
||||
$fd_row = $this->biz_settle_srv_model->get($where);
|
||||
if ($debug){
|
||||
echo "get 贷款配置(默认) : <br>";
|
||||
echo "get 贷款配置 : <br>";
|
||||
echo $this->biz_settle_srv_model->db->last_query()."<br>";
|
||||
var_dump($fd_row);
|
||||
echo "<br><br>";
|
||||
}
|
||||
if(!$fd_row){
|
||||
$fd_row = $this->biz_settle_srv_model->get(['biz_id'=>$item['biz_id'],'is_def'=>1,'status'=>1,'type'=>3,
|
||||
"JSON_UNQUOTE(json_extract(jsondata, '$.supplier_id')) = '{$finance_id}'" => null,
|
||||
"JSON_UNQUOTE(json_extract(jsondata, '$.finance_num')) = '{$finance_num}'" => null,
|
||||
"JSON_UNQUOTE(json_extract(jsondata, '$.rebate')) > 0" => null,
|
||||
]);
|
||||
if ($debug){
|
||||
echo "get 贷款配置(默认) : <br>";
|
||||
echo $this->biz_settle_srv_model->db->last_query()."<br>";
|
||||
var_dump($fd_row);
|
||||
echo "<br><br>";
|
||||
}
|
||||
}
|
||||
$fd_jsondata = json_decode($fd_row['jsondata'],true);
|
||||
$loan_fd = $fd_jsondata['rebate'] ? $fd_jsondata['rebate']/100:0;
|
||||
$profix_loan = $money_json['price_loan']*$loan_fd;
|
||||
}
|
||||
$fd_jsondata = json_decode($fd_row['jsondata'],true);
|
||||
$loan_fd = $fd_jsondata['rebate'] ? $fd_jsondata['rebate']/100:0;
|
||||
$profix_loan = $money_json['price_loan']*$loan_fd;
|
||||
|
||||
$srv_json['loan_srv_price'] = $profix_loan + $srv_loan;
|
||||
if ($debug){
|
||||
echo "是否贴息: is_tiexi: {$loan_row['is_tiexi']}"."<br>";
|
||||
echo "贷款返点: loan_fd: {$loan_fd}"."<br>";
|
||||
echo "贷款返点金额: profix_loan: {$profix_loan}"."<br>";
|
||||
echo "贷款手续费: srv_loan: {$srv_loan}"."<br>";
|
||||
|
||||
@@ -649,6 +649,7 @@ class CusorderV2 extends Wxapp
|
||||
];
|
||||
$data['price_loan'] = $money_json['price_loan'] ? $money_json['price_loan'] : 0.00;
|
||||
$data['num'] = $loan_row['num'] ? $loan_row['num'] : 0;
|
||||
$data['is_tiexi'] = intval($loan_row['is_tiexi']);
|
||||
$data['admin_name'] = '';
|
||||
if ($row['admin_id']) {
|
||||
$admin_row = $this->app_user_model->get(['id' => $row['admin_id']], 'uname');
|
||||
|
||||
@@ -41,7 +41,7 @@ class Loan extends Wxapp{
|
||||
$lend_file = $this->input_param('lend_file');
|
||||
$price_loan = $this->input_param('price_loan');
|
||||
$num = $this->input_param('num');
|
||||
|
||||
$is_tiexi = intval($this->input_param('is_tiexi'));
|
||||
|
||||
$order_row = $this->receiver_orders_v2_model->get(['id' => $oid], 'id,mobile,money_json,payway');
|
||||
$row = $this->order_loans_model->get(['o_id' => $oid]);
|
||||
@@ -77,6 +77,7 @@ class Loan extends Wxapp{
|
||||
];
|
||||
$lend_file && $update['lend_file'] = $lend_file;
|
||||
$num && $update['num'] = $num;
|
||||
$update['is_tiexi'] = $is_tiexi;
|
||||
$update && $result = $this->order_loans_model->update($update, ['id' => $row['id']]);
|
||||
throw new Exception('保存成功', API_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user