diff --git a/Application/Sdk/Controller/ShortcutController.class.php b/Application/Sdk/Controller/ShortcutController.class.php index d03adccc..9978a184 100644 --- a/Application/Sdk/Controller/ShortcutController.class.php +++ b/Application/Sdk/Controller/ShortcutController.class.php @@ -670,6 +670,7 @@ class ShortcutController extends BaseController{ exit; } + $payLimitConf = new PayLimitConfModel(); // 先判断意向记录支付请求情况 $check = $payLimitConf->check($request['user_id'], $request['price'], $payLimitConf::PAY_TYPE_SQPAY, $payInfo['order_id']); // 在更新历史支付请求订单提交情况 diff --git a/Application/Sdk/Model/PayChannelIntentionModel.class.php b/Application/Sdk/Model/PayChannelIntentionModel.class.php new file mode 100644 index 00000000..87d13a71 --- /dev/null +++ b/Application/Sdk/Model/PayChannelIntentionModel.class.php @@ -0,0 +1,64 @@ +tablePrefix ='tab_'; + /* 执行构造方法 */ + parent::__construct($name, $tablePrefix, $connection); + } + + public function paySubmit($orderId) { + if (!$orderId) return 0; + + $log = $this->where(array( + 'pay_order_number' => $orderId + ))->order('id desc')->find(); + + if (!$log) return 0; + $this->where(array( + 'id' => $log['id'] + ))->save(array( + 'is_submit' => 1 + )); + } + + // 支付成功 + public function updatePaySuccess($orderId) { + $this->where(array( + 'pay_order_number' => $orderId, + 'pay_status' => 0 + ))->save(array( + 'pay_status' => 1 + )); + } + + // 通知游戏成功 + public function updateGameNotifySuccess($orderId) { + $this->where(array( + 'pay_order_number' => $orderId, + 'pay_game_status' => 0 + ))->save(array( + 'pay_game_status' => 1 + )); + } + +} diff --git a/Application/Sdk/Model/UserPayWhitelistModel.class.php b/Application/Sdk/Model/UserPayWhitelistModel.class.php new file mode 100644 index 00000000..e1a9d8e3 --- /dev/null +++ b/Application/Sdk/Model/UserPayWhitelistModel.class.php @@ -0,0 +1,47 @@ +tablePrefix ='tab_'; + /* 执行构造方法 */ + parent::__construct($name, $tablePrefix, $connection); + } + + // 当前用户是否是有效白名单用户 reutrn 0无效 1有效 + public function verify($userId) { + if (!$userId) return 0; + $user = $this->where(array( + 'user_id' => $userId + ))->find(); + + if (!$user) return 0; + + if ($user['time'] == 1) return 1; + + if ($user['update_time'] + $user['time'] > time()) { + return 1; + } + + return 0; + } + +}