Преглед на файлове

Merge branch 'pre' into pro

kyle преди 2 години
родител
ревизия
be3d90fc11
променени са 37 файла, в които са добавени 94 реда и са изтрити 20 реда
  1. 9
    2
      app/Http/Controllers/Web/Api2021Controller.php
  2. 33
    12
      app/Http/Services/Web/Api2021Service.php
  3. 1
    1
      public/game/stopby/assets/css/2-chunk.css
  4. BIN
      public/game/stopby/assets/img/0_Loading.png
  5. BIN
      public/game/stopby/assets/img/description.png
  6. BIN
      public/game/stopby/assets/img/game/0_KV.png
  7. BIN
      public/game/stopby/assets/img/game/PayGI.png
  8. BIN
      public/game/stopby/assets/img/lottery/ball.png
  9. BIN
      public/game/stopby/assets/img/lottery/bg2.png
  10. BIN
      public/game/stopby/assets/img/lottery/title.png
  11. 0
    0
      public/game/stopby/assets/img/question/0_answer.png
  12. 0
    0
      public/game/stopby/assets/img/question/0_unanswer.png
  13. BIN
      public/game/stopby/assets/img/question/answer/1_answer.png
  14. BIN
      public/game/stopby/assets/img/question/answer/2_answer.png
  15. BIN
      public/game/stopby/assets/img/question/answer/3_answer.png
  16. BIN
      public/game/stopby/assets/img/question/answer/4_answer.png
  17. BIN
      public/game/stopby/assets/img/question/answer/5_answer.png
  18. BIN
      public/game/stopby/assets/img/question/answer/6_answer.png
  19. BIN
      public/game/stopby/assets/img/question/answer/7_answer.png
  20. BIN
      public/game/stopby/assets/img/question/answer/8_answer.png
  21. BIN
      public/game/stopby/assets/img/question/answer/9_answer.png
  22. BIN
      public/game/stopby/assets/img/question/backslash-left.png
  23. BIN
      public/game/stopby/assets/img/question/backslash-right.png
  24. BIN
      public/game/stopby/assets/img/question/slash-left.png
  25. BIN
      public/game/stopby/assets/img/question/slash-right.png
  26. BIN
      public/game/stopby/assets/img/question/unanswer/1_unanswer.png
  27. BIN
      public/game/stopby/assets/img/question/unanswer/2_unanswer.png
  28. BIN
      public/game/stopby/assets/img/question/unanswer/3_unanswer.png
  29. BIN
      public/game/stopby/assets/img/question/unanswer/4_unanswer.png
  30. BIN
      public/game/stopby/assets/img/question/unanswer/5_unanswer.png
  31. BIN
      public/game/stopby/assets/img/question/unanswer/6_unanswer.png
  32. BIN
      public/game/stopby/assets/img/question/unanswer/7_unanswer.png
  33. BIN
      public/game/stopby/assets/img/question/unanswer/8_unanswer.png
  34. BIN
      public/game/stopby/assets/img/question/unanswer/9_unanswer.png
  35. 1
    1
      public/game/stopby/assets/js/2-chunk.js
  36. 1
    1
      public/game/stopby/assets/js/index.js
  37. 49
    3
      public/game/stopby/index.html

+ 9
- 2
app/Http/Controllers/Web/Api2021Controller.php Целия файл

@@ -34,7 +34,7 @@ class Api2021Controller extends Controller
34 34
     
35 35
     public function __destruct()
36 36
     {
37
-//        $this->aSv->syslog($this->sisLog);
37
+        $this->aSv->syslog($this->sisLog);
38 38
     }
39 39
     
40 40
     // 申報系統(已廢棄)
@@ -307,7 +307,8 @@ class Api2021Controller extends Controller
307 307
 
308 308
         // 業務驗證(是否今日已玩過遊戲與簽到)
309 309
 //        if (false) { // testonly for 壓測
310
-        if ($lineId != 'Ud2534d6e1eed9cee2c919a993443352b') {
310
+//        if ($lineId != 'Ud2534d6e1eed9cee2c919a993443352b') {
311
+        if ($lineId != $this->settingManagementSv->getSetting()['GAME_TESTING_LINE_ID']) {
311 312
             if (!$this->aSv->canPlay($lineId)) {
312 313
                 $this->sisLog['memoIn'] = json_encode(['error' => 'logical'], JSON_UNESCAPED_UNICODE);
313 314
                 $this->sisLog['memoOut'] = json_encode(['msg' => '今日已玩過遊戲或者活動結束'], JSON_UNESCAPED_UNICODE);
@@ -923,6 +924,7 @@ class Api2021Controller extends Controller
923 924
         } else {
924 925
             $redis::incr($rlimitkey);
925 926
         }
927
+
926 928
         if ($redis::get($rlimitkey) > $this->settingManagementSv->getSetting()['TMZ_ESI_TEST_EVENT_LIMIT']) {
927 929
             $this->sisLog['memoIn'] = json_encode(['error' => 'logical'], JSON_UNESCAPED_UNICODE);
928 930
             $this->sisLog['memoOut'] = json_encode(['msg' => '測試點數不能再打了'], JSON_UNESCAPED_UNICODE);
@@ -939,8 +941,10 @@ class Api2021Controller extends Controller
939 941
             
940 942
             return response()->json(["succ" => false, "err" => '您操作過快,請稍後再試']);
941 943
         }
944
+
942 945
         // 業務驗證(是否加入LINE帳號的好友)
943 946
         if (!$this->aSv->lineFriendCheck($lineId, 'tmz')) {
947
+            $redis::expire($rkey, 15);
944 948
             $this->sisLog['memoIn'] = json_encode(['error' => 'logical'], JSON_UNESCAPED_UNICODE);
945 949
             $this->sisLog['memoOut'] = json_encode(['msg' => '請先加入 LINE 好友'], JSON_UNESCAPED_UNICODE);
946 950
             
@@ -948,6 +952,7 @@ class Api2021Controller extends Controller
948 952
         }
949 953
         // 業務驗證(是否在本地有資料)
950 954
         if (!$this->aSv->isTPlayer($lineId)) {
955
+            $redis::expire($rkey, 15);
951 956
             $this->sisLog['memoIn'] = json_encode(['error' => 'logical'], JSON_UNESCAPED_UNICODE);
952 957
             $this->sisLog['memoOut'] = json_encode(['msg' => '請從首頁進入'], JSON_UNESCAPED_UNICODE);
953 958
             
@@ -977,6 +982,7 @@ class Api2021Controller extends Controller
977 982
         }
978 983
         // 業務邏輯(可否轉蛋再次確認)
979 984
         if (!$this->aSv->tredeeminfo($lineId)) {
985
+            $redis::expire($rkey, 15);
980 986
             $this->sisLog['memoIn'] = json_encode(['error' => 'logical'], JSON_UNESCAPED_UNICODE);
981 987
             $this->sisLog['memoOut'] = json_encode(['msg' => '吉點不夠不能轉蛋'], JSON_UNESCAPED_UNICODE);
982 988
             
@@ -985,6 +991,7 @@ class Api2021Controller extends Controller
985 991
         // 業務邏輯(轉蛋兌點)
986 992
         $redeeminfo = $this->aSv->redeemTGood($lineId, $name);
987 993
         if (!$redeeminfo) {
994
+            $redis::expire($rkey, 15);
988 995
             $this->sisLog['memoIn'] = json_encode(['error' => 'logical'], JSON_UNESCAPED_UNICODE);
989 996
             $this->sisLog['memoOut'] = json_encode(['msg' => '銘謝惠顧'], JSON_UNESCAPED_UNICODE);
990 997
             

+ 33
- 12
app/Http/Services/Web/Api2021Service.php Целия файл

@@ -82,6 +82,7 @@ class Api2021Service
82 82
         $this->receiptManagementDb = new Receipt();
83 83
         $this->tplayerManagementDb = new TPlayer();
84 84
         $this->troundManagementDb = new TRound();
85
+        $this->tsessionManagementDb = new TSession();
85 86
         $this->tgoodManagementDb = new TGood();
86 87
         $this->tcheckinManagementDb = new TCheckinGpAlloc();
87 88
         $this->authLineUsersDb = new AuthLineUsers();
@@ -327,12 +328,9 @@ class Api2021Service
327 328
                 'cdate' => date("Y-m-d H:i:s"),
328 329
             ];
329 330
             if ($from) $data['kk'] = $from; // 區分來源(紀錄的 log 表不同)
330
-            // 經由計算取得的完整 request JSON
331
+
331 332
             $data['memoIn'] = json_encode(array_merge($param, $logdata), JSON_UNESCAPED_UNICODE);
332
-            // 調用 API 取得返回
333 333
             $data['memoOut'] = $res;
334
-
335
-            // 紀錄
336 334
             $this->syslog($data);
337 335
 
338 336
             // 返回值判斷
@@ -2814,6 +2812,7 @@ class Api2021Service
2814 2812
                     'totalQty',  //
2815 2813
                     'issuedQty', //
2816 2814
                 ])
2815
+                ->where('active', 'Y')
2817 2816
                 ->get()
2818 2817
                 ->toArray();
2819 2818
             $tgoodArr = [];
@@ -2832,6 +2831,9 @@ class Api2021Service
2832 2831
                 $tgoodinfo['totalQty'] - $tgoodinfo['issuedQty'] <= $this->settingManagementSv->getSetting()['TMZ_ISSUE_BUFFER']
2833 2832
                 || $tgoodinfo['active'] == GeneralConst::ACTIVE_NO
2834 2833
             ) {
2834
+                $this->debuglog('redeemTGood', [
2835
+                    'msg' => '所有銘謝惠顧的可能'
2836
+                ]);
2835 2837
                 return false;
2836 2838
             }
2837 2839
             // 銘謝惠顧獎項還是要扣除集點,所以不能返回錯誤,只是需要先控制不要進入直通
@@ -2916,6 +2918,7 @@ class Api2021Service
2916 2918
                 $data['memoIn'] = json_encode(array_merge($param, $logdata), JSON_UNESCAPED_UNICODE);
2917 2919
                 $data['memoOut'] = json_encode($resA, JSON_UNESCAPED_UNICODE);
2918 2920
                 $this->syslog($data);
2921
+
2919 2922
                 //
2920 2923
                 //
2921 2924
                 // 2/2 打點確認
@@ -2964,14 +2967,7 @@ class Api2021Service
2964 2967
                 ];
2965 2968
                 if (env('CERT_PASS') != '') $curlparam[ CURLOPT_KEYPASSWD ] = env('CERT_PASS');
2966 2969
                 if (env('CERT_PASS') != '') $curlparam[ CURLOPT_CAINFO ] = env('LOCAL_PATH') . 'cert/' . env('APP_ENV') . '_ca.pem';
2967
-                // 直通紀錄
2968
-                $data = [
2969
-                    'type'  => GeneralConst::LOG_ESI,
2970
-                    'func'  => 'LinepointQuery',
2971
-                    'k'     => $uid,
2972
-                    'kk'    => 'tmz',
2973
-                    'cdate' => date("Y-m-d H:i:s"),
2974
-                ];
2970
+
2975 2971
                 // 調用
2976 2972
                 $req = [
2977 2973
                     'curl'    => $curlparam,
@@ -2982,12 +2978,24 @@ class Api2021Service
2982 2978
                         'Accept'       => '*/*',
2983 2979
                     ]
2984 2980
                 ];
2981
+
2985 2982
                 if (!in_array($_SERVER['SERVER_ADDR'], ['172.31.30.167', '172.31.9.233', '172.31.42.197', '172.31.34.163'])) $req['proxy'] = env('CCH_PROXY');
2983
+
2986 2984
                 $response = $this->c->request('POST', env('API_BASE') . '/line/api/twpapi/linepoint/query', $req);
2987 2985
                 $resB = json_decode($response->getBody());
2986
+
2987
+                // 直通紀錄
2988
+                $data = [
2989
+                    'type'  => GeneralConst::LOG_ESI,
2990
+                    'func'  => 'LinepointQuery',
2991
+                    'k'     => $uid,
2992
+                    'kk'    => 'tmz',
2993
+                    'cdate' => date("Y-m-d H:i:s"),
2994
+                ];
2988 2995
                 $data['memoIn'] = json_encode(array_merge($param, $logdata), JSON_UNESCAPED_UNICODE);
2989 2996
                 $data['memoOut'] = json_encode($resB, JSON_UNESCAPED_UNICODE);
2990 2997
                 $this->syslog($data);
2998
+
2991 2999
                 // 打點返回成功,需要確認
2992 3000
                 //      確認成功,對用戶返回已打點的資訊,也計入資料庫
2993 3001
                 //      確認失敗,對用戶返回已打點的資訊,也計入資料庫(差別只在於 LOG 註記的內容不同)
@@ -2995,6 +3003,9 @@ class Api2021Service
2995 3003
                 //      確認成功,對用戶返回已打點的資訊,也計入資料庫(差別也只在於 LOG 註記的內容不同)
2996 3004
                 //      確認失敗,報錯
2997 3005
                 if ($resA->RCode != '0000' && $resB->RCode != '0000') {
3006
+                    $this->debuglog('redeemTGood', [
3007
+                        'msg' => '打點返回失敗,需要確認'
3008
+                    ]);
2998 3009
                     return false;
2999 3010
                 }
3000 3011
             }
@@ -3037,6 +3048,16 @@ class Api2021Service
3037 3048
             $data['memoIn'] = json_encode(['error' => 'exception'], JSON_UNESCAPED_UNICODE);
3038 3049
             $data['memoOut'] = json_encode(['code' => $ex->getCode(), 'msg' => $ex->getMessage()], JSON_UNESCAPED_UNICODE);
3039 3050
             $this->syslog($data);
3051
+
3052
+            $this->debuglog('redeemTGood', [
3053
+                'rqidA' => $rqidA ?? 0,
3054
+                'rqidB' => $rqidB ?? 0
3055
+            ], [
3056
+                'errCode' => $ex->getCode(),
3057
+                'requestTime' => $requestTime ?? '',
3058
+                'logTime' => date("Y-m-d H:i:s"),
3059
+                'errMsg' => $ex->getMessage(),
3060
+            ]);
3040 3061
             
3041 3062
             return false;
3042 3063
         }

+ 1
- 1
public/game/stopby/assets/css/2-chunk.css
Файловите разлики са ограничени, защото са твърде много
Целия файл


BIN
public/game/stopby/assets/img/0_Loading.png Целия файл


BIN
public/game/stopby/assets/img/description.png Целия файл


BIN
public/game/stopby/assets/img/game/0_KV.png Целия файл


BIN
public/game/stopby/assets/img/game/PayGI.png Целия файл


BIN
public/game/stopby/assets/img/lottery/ball.png Целия файл


BIN
public/game/stopby/assets/img/lottery/bg2.png Целия файл


BIN
public/game/stopby/assets/img/lottery/title.png Целия файл


public/game/stopby/assets/img/question/answer/0_answer.png → public/game/stopby/assets/img/question/0_answer.png Целия файл


public/game/stopby/assets/img/question/unanswer/0_unanswer.png → public/game/stopby/assets/img/question/0_unanswer.png Целия файл


BIN
public/game/stopby/assets/img/question/answer/1_answer.png Целия файл


BIN
public/game/stopby/assets/img/question/answer/2_answer.png Целия файл


BIN
public/game/stopby/assets/img/question/answer/3_answer.png Целия файл


BIN
public/game/stopby/assets/img/question/answer/4_answer.png Целия файл


BIN
public/game/stopby/assets/img/question/answer/5_answer.png Целия файл


BIN
public/game/stopby/assets/img/question/answer/6_answer.png Целия файл


BIN
public/game/stopby/assets/img/question/answer/7_answer.png Целия файл


BIN
public/game/stopby/assets/img/question/answer/8_answer.png Целия файл


BIN
public/game/stopby/assets/img/question/answer/9_answer.png Целия файл


BIN
public/game/stopby/assets/img/question/backslash-left.png Целия файл


BIN
public/game/stopby/assets/img/question/backslash-right.png Целия файл


BIN
public/game/stopby/assets/img/question/slash-left.png Целия файл


BIN
public/game/stopby/assets/img/question/slash-right.png Целия файл


BIN
public/game/stopby/assets/img/question/unanswer/1_unanswer.png Целия файл


BIN
public/game/stopby/assets/img/question/unanswer/2_unanswer.png Целия файл


BIN
public/game/stopby/assets/img/question/unanswer/3_unanswer.png Целия файл


BIN
public/game/stopby/assets/img/question/unanswer/4_unanswer.png Целия файл


BIN
public/game/stopby/assets/img/question/unanswer/5_unanswer.png Целия файл


BIN
public/game/stopby/assets/img/question/unanswer/6_unanswer.png Целия файл


BIN
public/game/stopby/assets/img/question/unanswer/7_unanswer.png Целия файл


BIN
public/game/stopby/assets/img/question/unanswer/8_unanswer.png Целия файл


BIN
public/game/stopby/assets/img/question/unanswer/9_unanswer.png Целия файл


+ 1
- 1
public/game/stopby/assets/js/2-chunk.js
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 1
- 1
public/game/stopby/assets/js/index.js
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 49
- 3
public/game/stopby/index.html Целия файл

@@ -1,3 +1,49 @@
1
-<!doctype html><html class="w-100 h-100 🤘🏻rockroll"><head><title>[台灣Pay]-串門子</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="ie=edge"><base href="https://d1ecgpmxczealj.cloudfront.net/pre/game/stopby/"><meta name="viewport" content="width=640,user-scalable=no"><meta name="description" content="[台灣Pay]-串門子"><meta property="og:locale" content="zh_TW"><meta property="og:title" content="[台灣Pay]-串門子"><meta property="og:description" content="[台灣Pay]-串門子"><meta property="og:image" content="https://www.taiwanpay.com.tw/content/imgs/fbimg.jpg"><meta property="og:type" content="article"><link rel="image_src" type="image/jpeg" href="https://www.taiwanpay.com.tw/content/imgs/fbimg.jpg"><link rel="shortcut icon" type="image/ico" href="favicon.ico"><link rel="stylesheet" href="assets/lib/slick/slick.css"><link href="assets/css/vendors-chunk.css?c8b3ea0fbc661c3e7473" rel="stylesheet"><link href="assets/css/index.css?5852e4b019b13864e0f7" rel="stylesheet"></head><body class="w-100 h-100 style-no-scroll style-hidden"><div id="app"></div><script src="https://cdn.jsdelivr.net/npm/vconsole@3.2.0/dist/vconsole.min.js"></script><script>if (window.location.host === 'declarepre.taiwanpay.com.tw') {
2
-        var vConsole = new VConsole();
3
-      }</script><script charset="utf-8" src="https://static.line-scdn.net/liff/edge/2/sdk.js"></script><script src="assets/lib/jquery-1.11.0.min.js" defer="defer"></script><script src="assets/lib/jquery-migrate-1.2.1.min.js" defer="defer"></script><script src="assets/lib/slick/slick.min.js" defer="defer"></script><script src="https://code.createjs.com/1.0.0/createjs.min.js"></script><script defer="defer" src="assets/js/vendors-chunk.js?76f8b527cd36c2c9dfad"></script><script defer="defer" src="assets/js/index.js?b2447fa543639b3ef524"></script></body></html>
1
+<!doctype html>
2
+<html class="w-100 h-100 🤘🏻rockroll">
3
+
4
+<head>
5
+  <title>[台灣Pay]-串門子</title>
6
+  <meta charset="UTF-8">
7
+  <meta http-equiv="X-UA-Compatible" content="ie=edge">
8
+  <base href="https://d1ecgpmxczealj.cloudfront.net/pre/game/stopby/">
9
+  <meta name="viewport" content="width=640,user-scalable=no">
10
+  <meta name="description" content="[台灣Pay]-串門子">
11
+  <meta property="og:locale" content="zh_TW">
12
+  <meta property="og:title" content="[台灣Pay]-串門子">
13
+  <meta property="og:description" content="[台灣Pay]-串門子">
14
+  <meta property="og:image" content="https://www.taiwanpay.com.tw/content/imgs/fbimg.jpg">
15
+  <meta property="og:type" content="article">
16
+  <link rel="image_src" type="image/jpeg" href="https://www.taiwanpay.com.tw/content/imgs/fbimg.jpg">
17
+  <link rel="shortcut icon" type="image/ico" href="favicon.ico">
18
+  <link rel="stylesheet" href="assets/lib/slick/slick.css">
19
+  <link href="assets/css/vendors-chunk.css?c8b3ea0fbc661c3e7473" rel="stylesheet">
20
+  <link href="assets/css/index.css?0a63016da077ce3151a4" rel="stylesheet">
21
+</head>
22
+
23
+<body class="w-100 h-100 style-no-scroll style-hidden">
24
+  <div id="app"></div>
25
+  <script src="https://cdn.jsdelivr.net/npm/vconsole@3.2.0/dist/vconsole.min.js"></script>
26
+  <script>if (window.location.host === 'declarepre.taiwanpay.com.tw') {
27
+      var vConsole = new VConsole();
28
+    }
29
+
30
+    function timeoutHandle() {
31
+      clearTimeout(window.timer);
32
+      window.timer = null;
33
+      window.interrupt = true;
34
+      alert("網路忙線中,請稍後再試");
35
+      window.timer = setTimeout(timeoutHandle, 30000);
36
+    }
37
+
38
+    window.timer = setTimeout(timeoutHandle, 30000);</script>
39
+  <script charset="utf-8" src="https://static.line-scdn.net/liff/edge/2/sdk.js"></script>
40
+  <script src="assets/lib/jquery-1.11.0.min.js" defer="defer"></script>
41
+  <script src="assets/lib/jquery-migrate-1.2.1.min.js" defer="defer"></script>
42
+  <script src="assets/lib/slick/slick.min.js" defer="defer"></script>
43
+  <script src="https://code.createjs.com/1.0.0/createjs.min.js"></script>
44
+  <script></script>
45
+  <script defer="defer" src="assets/js/vendors-chunk.js?76f8b527cd36c2c9dfad"></script>
46
+  <script defer="defer" src="assets/js/index.js?8c4a5bc8db699315eb7b"></script>
47
+</body>
48
+
49
+</html>