|
|
@ -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(){
|
|
|
|