|
|
|
@ -1010,29 +1010,29 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`;
|
|
|
|
|
$request = json_decode(think_decrypt($file),true); */
|
|
|
|
|
|
|
|
|
|
if (empty($request)) {
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'参数错误', 'user_token' => $this->userToken)));exit;
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>urlencode('参数错误'), 'user_token' => $this->userToken)));exit;
|
|
|
|
|
}
|
|
|
|
|
// 支付验证 是否让支付
|
|
|
|
|
$payCheck = pay_check($request['user_id']);
|
|
|
|
|
if (!$payCheck['code']) {
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=> $payCheck['msg'], 'user_token' => $this->userToken)));exit;
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=> urlencode($payCheck['msg']), 'user_token' => $this->userToken)));exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($request['price'] *1<=0) {
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'充值金额有误', 'user_token' => $this->userToken)));exit;
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>urlencode('充值金额有误'), 'user_token' => $this->userToken)));exit;
|
|
|
|
|
}
|
|
|
|
|
$request['price'] = abs($request['price']);
|
|
|
|
|
$extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'pay_status'=>1,'game_id'=>$request['game_id']))->find();
|
|
|
|
|
if($extend_data){
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'订单号重复,请关闭支付页面重新支付', 'user_token' => $this->userToken)));exit;
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>urlencode('订单号重复,请关闭支付页面重新支付'), 'user_token' => $this->userToken)));exit;
|
|
|
|
|
}
|
|
|
|
|
$user_info = get_user_entity($request['user_id']);
|
|
|
|
|
if($user_info['lock_status'] == 0 || $user_info['check_status'] == 0){
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'账号被禁用,无法充值,请联..系客服!', 'user_token' => $this->userToken)));exit;
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>urlencode('账号被禁用,无法充值,请联系客服!..'), 'user_token' => $this->userToken)));exit;
|
|
|
|
|
}
|
|
|
|
|
$game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('pay_status')->find();
|
|
|
|
|
if($game['pay_status'] == 0){
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'该游戏暂时无法充值,请联系客服!', 'user_token' => $this->userToken)));exit;
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>urlencode('该游戏暂时无法充值,请联系客服!'), 'user_token' => $this->userToken)));exit;
|
|
|
|
|
}
|
|
|
|
|
$out_trade_no = "PF_" . date('Ymd') . date('His') . sp_random_string(4);
|
|
|
|
|
if ($request['pay_order_number']) $out_trade_no = $request['pay_order_number'];
|
|
|
|
@ -1057,7 +1057,7 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`;
|
|
|
|
|
$block_data['check_status'] = 0;
|
|
|
|
|
$block_data['block_time'] = time();
|
|
|
|
|
$user->where(['id'=>$user_entity['id']])->save($block_data);
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'您的账号暂时无法充值,请联系客服处理.', 'user_token' => $this->userToken)));exit;
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>urlencode('您的账号暂时无法充值,请联系客服处理.'), 'user_token' => $this->userToken)));exit;
|
|
|
|
|
}
|
|
|
|
|
$result = false;
|
|
|
|
|
$notice_order = []; // 需要更新的通知游戏订单
|
|
|
|
@ -1070,7 +1070,7 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`;
|
|
|
|
|
$user_play_data = $user_play->where($user_play_map)->find();
|
|
|
|
|
$balance = $user->where(array('id' => $request['user_id']))->getField("balance");
|
|
|
|
|
if ($balance + $user_play_data['bind_balance'] < $request['price']) {
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'您金额不足,请退出重试.', 'user_token' => $this->userToken)));exit;
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>urlencode('您金额不足,请退出重试.'), 'user_token' => $this->userToken)));exit;
|
|
|
|
|
}
|
|
|
|
|
if ($user_play_data['bind_balance'] < $request['price']) {
|
|
|
|
|
$price = $request['price'];
|
|
|
|
@ -1087,7 +1087,7 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`;
|
|
|
|
|
$request['pay_order_number'] = $pay_order_number;
|
|
|
|
|
$request['pay_way'] = 0; // 扣平台币
|
|
|
|
|
$real_price = $price - $user_play_data['bind_balance'];
|
|
|
|
|
$valueDetailLogModel->addLog($request['user_id'], $request['pay_order_number'], $balance, -$real_price, 0, $valueDetailLogModel::BALANCE, "平台币消费:".$real_price);
|
|
|
|
|
$valueDetailLogModel->addLog($request['user_id'], $request['pay_order_number'], $balance, -$real_price, $balance-$real_price, $valueDetailLogModel::BALANCE, "平台币消费:".$real_price);
|
|
|
|
|
$user->where(array('id' => $request["user_id"]))->setDec("balance", $real_price);
|
|
|
|
|
//$this->set_message(0,"fail", $request['pay_order_number']);
|
|
|
|
|
|
|
|
|
|