diff --git a/Application/Sdk/Controller/WapPayController.class.php b/Application/Sdk/Controller/WapPayController.class.php index 690f8151..e1512c5d 100644 --- a/Application/Sdk/Controller/WapPayController.class.php +++ b/Application/Sdk/Controller/WapPayController.class.php @@ -574,32 +574,22 @@ class WapPayController extends BaseController{ $request = json_decode(think_decrypt($file),true); Log::write(serialize($request), Log::DEBUG); - $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', // 游戏充值 - ]); + $is_platform = 0; + if (I('request.code') == 0 && I('request.type') == 'platform') { + $is_platform = 1; // 平台币充值 } - $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['user_id'] = I('request.user_id'); - $request['price'] = I('request.price'); + $request['price'] = intval(I('request.price')); $request['game_id'] = I('request.game_id'); $type = "platform"; - $is_platform = 1; - $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_way'] = C("PAY_WAY.SQ_SHORTCUT"); // 支付方式(-1绑币 0:平台币,1:支付宝,2:微信(扫码)3微信app 4 威富通 5聚宝云 6竣付通 7苹果支付8金猪支付 9双乾支付-支付宝 10双乾支付-银联 15双乾支付-快捷 $request['pay_status'] = 0; $request['spend_ip'] = get_client_ip(); $out_trade_no = $request['pay_order_number']; @@ -616,10 +606,23 @@ class WapPayController extends BaseController{ if (!$ret) { 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'); /* $request['user_id'] = 232; $request['game_id'] = 78;