From 9316dedc6c32f1777f101ed0dda54c60d1497e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9C=E2=80=98?= <“chenzhi063@qq.com> Date: Wed, 16 Oct 2019 11:35:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/Controller/Ipa365Controller.class.php | 110 +++++++++--------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/Application/Sdk/Controller/Ipa365Controller.class.php b/Application/Sdk/Controller/Ipa365Controller.class.php index 852089fa2..eb894bb8b 100644 --- a/Application/Sdk/Controller/Ipa365Controller.class.php +++ b/Application/Sdk/Controller/Ipa365Controller.class.php @@ -103,69 +103,69 @@ class Ipa365Controller extends BaseController{ * 发起支付 */ public function pay() { - // $userId = $this->userinfo['user_id']; - // if (!$userId ) { - // $this->error("请登入", "/mobile.php/ssg/login"); - // } + $userId = $this->userinfo['user_id']; + if (!$userId ) { + $this->error("请登入", "/mobile.php/ssg/login"); + } - // $gameId = I("game_id", 0); - // $price = self::signprice; + $gameId = I("game_id", 0); + $price = self::signprice; - // if (!$userId || !$gameId) { - // $this->error("参数有误!"); - // } + if (!$userId || !$gameId) { + $this->error("参数有误!"); + } - // $payLog = M('game_supersign', 'tab_')->where(array( - // 'user_id' => $userId, - // 'game_id' => $gameId, - // 'pay_status' => 0 - // ))->find(); - // if ($payLog) { - // $orderId = $payLog['order_id']; - // } else { - // $orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签 + $payLog = M('game_supersign', 'tab_')->where(array( + 'user_id' => $userId, + 'game_id' => $gameId, + 'pay_status' => 0 + ))->find(); + if ($payLog) { + $orderId = $payLog['order_id']; + } else { + $orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签 - // $gameInfo = M('game', 'tab_')->field('supersign_token')->where(array( - // 'id' => $gameId, - // ))->find(); - // if (!$gameInfo['supersign_token']) { - // $this->error("超级签token未填写!"); - // } + $gameInfo = M('game', 'tab_')->field('supersign_token')->where(array( + 'id' => $gameId, + ))->find(); + if (!$gameInfo['supersign_token']) { + $this->error("超级签token未填写!"); + } - // $r = M('game_supersign', 'tab_')->add(array( - // 'udid' => '', - // 'user_id' => $userId, - // 'game_id' => $gameId, - // 'order_id' => $orderId, - // 'pay_price' => $price, - // 'pay_status' => 0, - // 'ticket' => '', // 调用安装的时候分配 - // 'token' => $gameInfo['supersign_token'], - // 'create_time' => time() - // )); - // if (!$r) return -1; - // } + $r = M('game_supersign', 'tab_')->add(array( + 'udid' => '', + 'user_id' => $userId, + 'game_id' => $gameId, + 'order_id' => $orderId, + 'pay_price' => $price, + 'pay_status' => 0, + 'ticket' => '', // 调用安装的时候分配 + 'token' => $gameInfo['supersign_token'], + 'create_time' => time() + )); + if (!$r) return -1; + } - // $param['price'] = $price; - // $param['sdk_version'] = '2'; - // $param['user_id'] = $userId; - // $param['game_id'] = $gameId; - // $param['order_id'] = $orderId; - // $param['apitype'] = "alipay"; - // $param['config'] = "alipay"; - // $param['signtype']= "MD5"; - // $param['server'] = "alipay.wap.create.direct.pay.by.user"; - // $param['payway'] = 1; - // $param['title'] = $price; - // $param['body'] = $price; - // $param['callback'] = "https://m.wmtxkj.com/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}"; - // $param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay"; + $param['price'] = $price; + $param['sdk_version'] = '2'; + $param['user_id'] = $userId; + $param['game_id'] = $gameId; + $param['order_id'] = $orderId; + $param['apitype'] = "alipay"; + $param['config'] = "alipay"; + $param['signtype']= "MD5"; + $param['server'] = "alipay.wap.create.direct.pay.by.user"; + $param['payway'] = 1; + $param['title'] = $price; + $param['body'] = $price; + $param['callback'] = "https://m.wmtxkj.com/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}"; + $param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay"; - // $ret = $this->alipay($param); + $ret = $this->alipay($param); - // $this->assign("price", self::signprice); - // $this->assign("url", $ret['url']); - // $this->assign("order_id", $orderId); + $this->assign("price", self::signprice); + $this->assign("url", $ret['url']); + $this->assign("order_id", $orderId); // pp($orderId); // redirect($ret['url']);