|
|
@ -574,32 +574,22 @@ class WapPayController extends BaseController{
|
|
|
|
$request = json_decode(think_decrypt($file),true);
|
|
|
|
$request = json_decode(think_decrypt($file),true);
|
|
|
|
Log::write(serialize($request), Log::DEBUG);
|
|
|
|
Log::write(serialize($request), Log::DEBUG);
|
|
|
|
|
|
|
|
|
|
|
|
$payInfo = M('pay_info', 'tab_')->where([
|
|
|
|
$is_platform = 0;
|
|
|
|
'user_id' => I('user_id'),
|
|
|
|
if (I('request.code') == 0 && I('request.type') == 'platform') {
|
|
|
|
'game_id' => I('game_id'),
|
|
|
|
$is_platform = 1; // 平台币充值
|
|
|
|
'extend' => I('extend'),
|
|
|
|
|
|
|
|
])->order('id desc')->find();
|
|
|
|
|
|
|
|
if ($payInfo) {
|
|
|
|
|
|
|
|
M('pay_info', 'tab_')->where([
|
|
|
|
|
|
|
|
'id' => $payInfo['id']
|
|
|
|
|
|
|
|
])->save([
|
|
|
|
|
|
|
|
'type' => 'sq_shortcut', // 游戏充值
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$is_platform = 0;
|
|
|
|
$prefix = ($is_platform == 1) ? 'PF_' : 'SP_';
|
|
|
|
|
|
|
|
$request['pay_order_number'] = $prefix . date('Ymd') . date('His') . sp_random_string(4);
|
|
|
|
|
|
|
|
|
|
|
|
// 平台币充值
|
|
|
|
// 平台币充值
|
|
|
|
if (I('request.code') == 0 && I('request.type') == 'platform') {
|
|
|
|
if ($is_platform) {
|
|
|
|
$request['code'] = 0;
|
|
|
|
$request['code'] = 0;
|
|
|
|
$request['user_id'] = I('request.user_id');
|
|
|
|
$request['user_id'] = I('request.user_id');
|
|
|
|
$request['price'] = I('request.price');
|
|
|
|
$request['price'] = intval(I('request.price'));
|
|
|
|
$request['game_id'] = I('request.game_id');
|
|
|
|
$request['game_id'] = I('request.game_id');
|
|
|
|
$type = "platform";
|
|
|
|
$type = "platform";
|
|
|
|
$is_platform = 1;
|
|
|
|
$request['pay_way'] = C("PAY_WAY.SQ_SHORTCUT"); // 支付方式(-1绑币 0:平台币,1:支付宝,2:微信(扫码)3微信app 4 威富通 5聚宝云 6竣付通 7苹果支付8金猪支付 9双乾支付-支付宝 10双乾支付-银联 15双乾支付-快捷
|
|
|
|
$table = $request['code'] == 1 ? "spend" : "deposit";
|
|
|
|
|
|
|
|
$prefix = $request['code'] == 1 ? "SP_" : "PF_";
|
|
|
|
|
|
|
|
$request['pay_order_number'] = $prefix . date('Ymd') . date('His') . sp_random_string(4);
|
|
|
|
|
|
|
|
$request['pay_way'] = 15; // 支付方式(-1绑币 0:平台币,1:支付宝,2:微信(扫码)3微信app 4 威富通 5聚宝云 6竣付通 7苹果支付8金猪支付 9双乾支付-支付宝 10双乾支付-银联 15双乾支付-快捷
|
|
|
|
|
|
|
|
$request['pay_status'] = 0;
|
|
|
|
$request['pay_status'] = 0;
|
|
|
|
$request['spend_ip'] = get_client_ip();
|
|
|
|
$request['spend_ip'] = get_client_ip();
|
|
|
|
$out_trade_no = $request['pay_order_number'];
|
|
|
|
$out_trade_no = $request['pay_order_number'];
|
|
|
@ -616,10 +606,23 @@ class WapPayController extends BaseController{
|
|
|
|
if (!$ret) {
|
|
|
|
if (!$ret) {
|
|
|
|
return ;
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else { // 游戏充值
|
|
|
|
|
|
|
|
$request['code'] = 1;
|
|
|
|
|
|
|
|
$payInfo = M('pay_info', 'tab_')->where([
|
|
|
|
|
|
|
|
'user_id' => I('user_id'),
|
|
|
|
|
|
|
|
'game_id' => I('game_id'),
|
|
|
|
|
|
|
|
'extend' => I('extend'),
|
|
|
|
|
|
|
|
])->order('id desc')->find();
|
|
|
|
|
|
|
|
if ($payInfo) {
|
|
|
|
|
|
|
|
M('pay_info', 'tab_')->where([
|
|
|
|
|
|
|
|
'id' => $payInfo['id']
|
|
|
|
|
|
|
|
])->save([
|
|
|
|
|
|
|
|
'type' => 'sq_shortcut', // 游戏充值
|
|
|
|
|
|
|
|
'order_id' => $request['pay_order_number']
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($is_platform) {
|
|
|
|
|
|
|
|
$request['price'] = intval($request['price']);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$userToken = I('request.user_token');
|
|
|
|
$userToken = I('request.user_token');
|
|
|
|
/* $request['user_id'] = 232;
|
|
|
|
/* $request['user_id'] = 232;
|
|
|
|
$request['game_id'] = 78;
|
|
|
|
$request['game_id'] = 78;
|
|
|
|