优化提交

master
chenzhi 3 years ago
parent 606218140d
commit ae82a0b632

@ -99,6 +99,7 @@ class CoinOrderController extends BaseController
} }
} }
$this->assign("LV",self::LV); $this->assign("LV",self::LV);
$config = $this->getOfflineConfig();
if(IS_POST){ if(IS_POST){
SafeFilter($_POST); SafeFilter($_POST);
$coin_num = I("coin_num"); $coin_num = I("coin_num");
@ -121,15 +122,22 @@ class CoinOrderController extends BaseController
$data['pay_amount'] = bcadd($coin_num,$free,2); $data['pay_amount'] = bcadd($coin_num,$free,2);
$data['order_status'] = 0; $data['order_status'] = 0;
}else{ }else{
$data['pay_amount'] = $coin_num; if($config['is_open'] != 1) {
$this->ajaxReturn(['status'=>0,'info'=>'配置错误','time'=>1000],"JSON");
}
$data['pay_amount'] = sprintf("%.2f",$coin_num*($config['coin_discount']*10)/100);
$collection_account = I("collection_account",""); $collection_account = I("collection_account","");
$pay_order_number = I("pay_order_number"); $pay_order_number = I("pay_order_number");
/*if($collection_account==''){ $game_id = I("game_id", 0);
$this->ajaxReturn(['status'=>0,'info'=>'请选择汇入银行','time'=>1000],"JSON"); if($game_id < 1){
}*/ $this->ajaxReturn(['status'=>0,'info'=>'请选择游戏','time'=>1000],"JSON");
}
if($pay_order_number==''){ if($pay_order_number==''){
$this->ajaxReturn(['status'=>0,'info'=>'请输入支付凭证','time'=>1000],"JSON"); $this->ajaxReturn(['status'=>0,'info'=>'请输入支付凭证','time'=>1000],"JSON");
} }
$is_order = M("coin_pay_order","tab_") $is_order = M("coin_pay_order","tab_")
->where( ->where(
array('pay_order_number'=>$pay_order_number, array('pay_order_number'=>$pay_order_number,
@ -151,7 +159,9 @@ class CoinOrderController extends BaseController
$data['remark'] = I("remark"); $data['remark'] = I("remark");
$data['voucher_img'] = $res['id']; $data['voucher_img'] = $res['id'];
$data['order_status'] = 2; $data['order_status'] = 2;
$data['pay_way'] = 3; $data['pay_way'] = 4;
$data['game_id'] = $game_id;
$data['discount'] = $config['coin_discount'] * 10;
} }
M("coin_pay_order", 'tab_')->add($data); M("coin_pay_order", 'tab_')->add($data);
recordPromoteLogs('平台币管理','提交充值订单'); recordPromoteLogs('平台币管理','提交充值订单');
@ -163,9 +173,30 @@ class CoinOrderController extends BaseController
$this->assign("account",$account); $this->assign("account",$account);
$this->assign("bank_list",$bank_list); $this->assign("bank_list",$bank_list);
$this->assign("discount","0"); $this->assign("discount","0");
$this->assign("config", $config);
$this->display(); $this->display();
} }
} }
private function getOfflineConfig()
{
$config = M("Kv")->where("`key` like 'offline_platform_coin_%'")->getField('key,value',true);
$pid = session('promote_auth.pid');
$sendArr = [
'is_open'=>0
];
if(isset($config['offline_platform_coin_promote_ids'])){
$promote_ids = explode(',', $config['offline_platform_coin_promote_ids']);
if(in_array($pid, $promote_ids)) {
$sendArr['is_open'] = 1;
}
}
if($sendArr['is_open'] == 1) {
$sendArr['game'] = M('Game', 'tab_')->where("id in ({$config['offline_platform_coin_game_ids']})")->getField('id,game_name');
$sendArr['coin_discount'] = ($config['offline_platform_coin_discount']?:100) / 10;
$sendArr['collection_img_path'] = $config['offline_platform_coin_collection_img_path'];
}
return $sendArr;
}
//订单明细 //订单明细
public function order_detail(){ public function order_detail(){

@ -30,8 +30,32 @@
</div> </div>
</div> </div>
<div class="trunk-list"> <div class="trunk-list">
<form id="payform" action="{:U('agent_pay')}" method="post" enctype="multipart/form-data"> <form id="payform" action="{:U('agent_pay')}" method="post" enctype="multipart/form-data" style="position: relative;">
<div class="remittance" hidden style="width: 300px;height: 450px;position: absolute;left: 600px;top: 0;">
<img style="width: 100%;" src="{$config.collection_img_path}" />
</div>
<table class="table2"> <table class="table2">
<tr>
<td class="l">充值方式:</td>
<td class="r form-radio jspayradio">
<label><input type="radio" value="1" name="pay_type" checked><i class="current"></i><span>在线转账</span></label>
<if condition="$config['is_open'] == 1 ">
<label><input type="radio" value="2" name="pay_type"><i></i><span>线下转账</span><span class="noticetxt">(需上传截图)</span></label>
</if>
</td>
</tr>
<tr class="remittance" hidden>
<td class="l">请选择游戏</td>
<td class="r">
<select class="reselect select_gallery" name="game_id">
<option value="">请选择游戏</option>
<foreach name="config.game" item="vo" >
<option value="{$key}">{$vo}</option>
</foreach>
</select>
<div id="acountesc"></div>
</td>
</tr>
<tr> <tr>
<td class="l">充值账号:</td> <td class="l">充值账号:</td>
<td class="r"><span >{$account}</span></td> <td class="r"><span >{$account}</span></td>
@ -40,26 +64,25 @@
<td class="l">平台币原价:</td> <td class="l">平台币原价:</td>
<td class="r">¥1.00/个</td> <td class="r">¥1.00/个</td>
</tr> </tr>
<if condition="$config.coin_discount neq 10 ">
<tr class="remittance" hidden>
<td class="l">平台币限时折扣:</td>
<td class="r"><span >{$config.coin_discount}折</span></td>
</tr>
</if>
<tr> <tr>
<td class="l">购买数量:</td> <td class="l">购买数量:</td>
<td class="r"><input type="text" class="txt" name="coin_num" autocomplete="off" placeholder="" oninput="this.value=this.value.replace(/[^0-9]+|^0|\d{9}/,'');"> <td class="r"><input type="text" class="txt" name="coin_num" autocomplete="off" placeholder="" oninput="this.value=this.value.replace(/[^0-9]+|^0|\d{9}/,'');">
<span class="noticetxt">平台币</span> <span class="noticetxt">平台币</span>
</td> </td>
</tr> </tr>
<tr>
<td class="l">充值方式:</td>
<td class="r form-radio jspayradio">
<label><input type="radio" value="1" name="pay_type" checked><i class="current"></i><span>在线转账</span></label>
<!-- <label><input type="radio" value="2" name="pay_type"><i></i><span>线下转账</span><span class="noticetxt">(需上传截图)</span></label> -->
</td>
</tr>
<tr> <tr>
<td class="l">应付金额:</td> <td class="l">应付金额:</td>
<td class="r" id="pay_amount"><span>0.00</span> <td class="r" id="pay_amount"><span>0.00</span>
<input name="discount" value="{$discount}" type="hidden"> <input name="discount" value="{$discount}" type="hidden">
</td> </td>
</tr> </tr>
<tr class="remittance" hidden> <!-- <tr class="remittance" hidden>
<td class="l">汇入银行:</td> <td class="l">汇入银行:</td>
<td class="r"> <td class="r">
<select class="reselect select_gallery" name="collection_account"> <select class="reselect select_gallery" name="collection_account">
@ -70,10 +93,11 @@
</select> </select>
<div id="acountesc"></div> <div id="acountesc"></div>
</td> </td>
</tr> </tr> -->
<tr class="remittance" hidden> <tr class="remittance" hidden>
<td class="l">支付凭证</td> <td class="l">订单号</td>
<td class="r"><input type="text" class="txt" name="pay_order_number" autocomplete="off" placeholder="请输入支付凭证"></td> <td class="r"><input type="text" class="txt" name="pay_order_number" autocomplete="off" placeholder="请输入订单号"></td>
</tr> </tr>
<tr class="remittance" hidden> <tr class="remittance" hidden>
<td class="l">支付截图:</td> <td class="l">支付截图:</td>
@ -85,6 +109,11 @@
<textarea name="remark"></textarea> <textarea name="remark"></textarea>
</td> </td>
</tr> </tr>
<tr class="remittance" hidden>
<td class="l" colspan="2" style="text-align: center;">
<span class="noticetxt">(特殊说明:折扣购买的平台币不参与结算)</span>
</td>
</tr>
<tr id="tip"> <tr id="tip">
<td class="l" colspan="2"> <td class="l" colspan="2">
<span class="noticetxt">(手续费说明:每笔交易支付服务商将收取 {$LV}% 手续费最低收取0.1元,上不封顶)</span> <span class="noticetxt">(手续费说明:每笔交易支付服务商将收取 {$LV}% 手续费最低收取0.1元,上不封顶)</span>
@ -148,7 +177,11 @@
fee=0.1 fee=0.1
} }
coin_num = fee+parseFloat(coin_num); coin_num = fee+parseFloat(coin_num);
}else{ }else{ //线下打款
var discount = '{$config.coin_discount}';
if(discount < 10) {
coin_num = (discount*10)*coin_num/100;
}
coin_num = parseFloat(coin_num) coin_num = parseFloat(coin_num)
} }
coin_num = coin_num.toFixed(2); coin_num = coin_num.toFixed(2);

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB

Loading…
Cancel
Save