Browse Source

Merge branch 'Thailand' of https://gitee.com/wangwenfan/congkong into Thailand

mafei 1 year ago
parent
commit
01035a0b19
2 changed files with 6 additions and 4 deletions
  1. 1 1
      webServer/src/controller/ApiController.ts
  2. 5 3
      webServer/src/utils/retryPay.php

+ 1 - 1
webServer/src/controller/ApiController.ts

@@ -882,7 +882,7 @@ class ApiController {
 
 
     async getNotice(ctx) {
     async getNotice(ctx) {
         let data = ctx.request.body
         let data = ctx.request.body
-        let platform = data.platform || 'th'
+        let platform = data.platform || '360'
 
 
         switch (platform) {
         switch (platform) {
             case 'th':
             case 'th':

+ 5 - 3
webServer/src/utils/googlePay.php → webServer/src/utils/retryPay.php

@@ -16,13 +16,13 @@ if ($connection->connect_error) {
 $now = time();
 $now = time();
  
  
 // 半小时之前的时间戳
 // 半小时之前的时间戳
-$halfHourAgo = strtotime("-60 minutes", $now);
+$halfHourAgo = strtotime("-120 minutes", $now);
  
  
 // 格式化时间戳为日期时间字符串
 // 格式化时间戳为日期时间字符串
 $halfHourAgoFormatted = date("Y-m-d H:i:s", $halfHourAgo);
 $halfHourAgoFormatted = date("Y-m-d H:i:s", $halfHourAgo);
 
 
 // 查询数据库
 // 查询数据库
-$query = "SELECT * FROM game_order where status= 1 and token != '' and platform = 'google' and create_time >= '{$halfHourAgoFormatted}' order by id desc";
+$query = "SELECT * FROM game_order where status= 1 and token != '' and create_time >= '{$halfHourAgoFormatted}' ";
 $result = $connection->query($query);
 $result = $connection->query($query);
 
 
 $data = [];
 $data = [];
@@ -44,10 +44,12 @@ if(empty($data)){
 foreach ($data as $val) {
 foreach ($data as $val) {
     $apiParams = [
     $apiParams = [
         'orderId' => $val['order_id'],
         'orderId' => $val['order_id'],
-        'platform' => 'google',
+        'platform' => $val['platform'],
         'purchaseToken' => $val['token']
         'purchaseToken' => $val['token']
     ];
     ];
 
 
+    var_dump($apiParams['orderId']);
+
     // 发送POST请求
     // 发送POST请求
     $url = 'http://sso.skystoryorigin.com:3000/callback';
     $url = 'http://sso.skystoryorigin.com:3000/callback';
     $jsonStr = json_encode($apiParams);
     $jsonStr = json_encode($apiParams);