|  | @@ -359,6 +359,7 @@ class Api2021Controller extends Controller
 | 
	
		
			
			| 359 | 359 |          $this->sisLog['k'] = $lineId;
 | 
	
		
			
			| 360 | 360 |          $this->sisLog['memoIn'] = '';
 | 
	
		
			
			| 361 | 361 |          $this->sisLog['memoOut'] = '';
 | 
	
		
			
			|  | 362 | +
 | 
	
		
			
			| 362 | 363 |          // 打點數量限制
 | 
	
		
			
			| 363 | 364 |          // 作用範圍: ALL
 | 
	
		
			
			| 364 | 365 |          $redis = new Redis();
 | 
	
	
		
			
			|  | @@ -375,6 +376,12 @@ class Api2021Controller extends Controller
 | 
	
		
			
			| 375 | 376 |              
 | 
	
		
			
			| 376 | 377 |              return response()->json(["succ" => false, "err" => '測試點數不能再打了']);
 | 
	
		
			
			| 377 | 378 |          }
 | 
	
		
			
			|  | 379 | +
 | 
	
		
			
			|  | 380 | +        \Log::debug($rlimitkey);
 | 
	
		
			
			|  | 381 | +        \Log::debug($redis::get($rlimitkey));
 | 
	
		
			
			|  | 382 | +
 | 
	
		
			
			|  | 383 | +        return response()->json(["succ" => true, "err" => 'okok']);
 | 
	
		
			
			|  | 384 | +
 | 
	
		
			
			| 378 | 385 |          // 業務驗證(防重)
 | 
	
		
			
			| 379 | 386 |          // 作用範圍: 以人為單位
 | 
	
		
			
			| 380 | 387 |          $rkey = $this->settingManagementSv->getSetting()['GAME_ESI_TEST_EVENT_LIMIT'] . '_' . $lineId;
 | 
	
	
		
			
			|  | @@ -385,20 +392,25 @@ class Api2021Controller extends Controller
 | 
	
		
			
			| 385 | 392 |              
 | 
	
		
			
			| 386 | 393 |              return response()->json(["succ" => false, "err" => '您操作過快,請稍後再試']);
 | 
	
		
			
			| 387 | 394 |          }
 | 
	
		
			
			|  | 395 | +
 | 
	
		
			
			|  | 396 | +//        return response()->json(["succ" => true, "err" => 'okok']);
 | 
	
		
			
			|  | 397 | +
 | 
	
		
			
			| 388 | 398 |          // 業務驗證(是否加入LINE帳號的好友)
 | 
	
		
			
			| 389 | 399 |          if (!$this->aSv->lineFriendCheck($lineId)) {
 | 
	
		
			
			| 390 | 400 |              $this->sisLog['memoIn'] = json_encode(['error' => 'logical'], JSON_UNESCAPED_UNICODE);
 | 
	
		
			
			| 391 | 401 |              $this->sisLog['memoOut'] = json_encode(['msg' => '請先加入 LINE 好友'], JSON_UNESCAPED_UNICODE);
 | 
	
		
			
			| 392 |  | -            
 | 
	
		
			
			|  | 402 | +
 | 
	
		
			
			| 393 | 403 |              return response()->json(["succ" => false, "err" => '請先加入 LINE 好友']);
 | 
	
		
			
			| 394 | 404 |          }
 | 
	
		
			
			|  | 405 | +
 | 
	
		
			
			| 395 | 406 |          // 業務驗證(是否在本地有資料)
 | 
	
		
			
			| 396 | 407 |          if (!$this->aSv->isPlayer($lineId)) {
 | 
	
		
			
			| 397 | 408 |              $this->sisLog['memoIn'] = json_encode(['error' => 'logical'], JSON_UNESCAPED_UNICODE);
 | 
	
		
			
			| 398 | 409 |              $this->sisLog['memoOut'] = json_encode(['msg' => '請從首頁進入'], JSON_UNESCAPED_UNICODE);
 | 
	
		
			
			| 399 |  | -            
 | 
	
		
			
			|  | 410 | +
 | 
	
		
			
			| 400 | 411 |              return response()->json(["succ" => false, "err" => '請從首頁進入']);
 | 
	
		
			
			| 401 | 412 |          }
 | 
	
		
			
			|  | 413 | +
 | 
	
		
			
			| 402 | 414 |          // 業務驗證(取得當回合的兌獎狀態,包含所有獎項以及可換與否,拿來比對驗證)
 | 
	
		
			
			| 403 | 415 |          $canuse = false;
 | 
	
		
			
			| 404 | 416 |          foreach ($this->aSv->goodinfo($lineId) as $g) if ($g['id'] == $gid) if ($g['canuse'] == true) $canuse = true;
 | 
	
	
		
			
			|  | @@ -408,6 +420,7 @@ class Api2021Controller extends Controller
 | 
	
		
			
			| 408 | 420 |              
 | 
	
		
			
			| 409 | 421 |              return response()->json(["succ" => false, "err" => '獎項不存在或沒有兌獎所需吉點']);
 | 
	
		
			
			| 410 | 422 |          }
 | 
	
		
			
			|  | 423 | +
 | 
	
		
			
			| 411 | 424 |          // 參數驗證
 | 
	
		
			
			| 412 | 425 |          $name = '';
 | 
	
		
			
			| 413 | 426 |          $messages = [
 | 
	
	
		
			
			|  | @@ -430,6 +443,7 @@ class Api2021Controller extends Controller
 | 
	
		
			
			| 430 | 443 |          } else {
 | 
	
		
			
			| 431 | 444 |              $name = $request->input('name', '');
 | 
	
		
			
			| 432 | 445 |          }
 | 
	
		
			
			|  | 446 | +
 | 
	
		
			
			| 433 | 447 |          // 業務邏輯(兌點)
 | 
	
		
			
			| 434 | 448 |          $redeeminfo = $this->aSv->redeemGood($lineId, $gid, $name);
 | 
	
		
			
			| 435 | 449 |          if (!$redeeminfo) {
 | 
	
	
		
			
			|  | @@ -438,9 +452,11 @@ class Api2021Controller extends Controller
 | 
	
		
			
			| 438 | 452 |              
 | 
	
		
			
			| 439 | 453 |              return response()->json(["succ" => false, "err" => '兌換失敗']);
 | 
	
		
			
			| 440 | 454 |          }
 | 
	
		
			
			|  | 455 | +
 | 
	
		
			
			| 441 | 456 |          // 資料整理
 | 
	
		
			
			| 442 | 457 |          $this->sisLog['memoIn'] = json_encode(['lineId' => $lineId, 'gid' => $gid], JSON_UNESCAPED_UNICODE);
 | 
	
		
			
			| 443 | 458 |          $this->sisLog['memoOut'] = json_encode(['redeeminfo' => $redeeminfo], JSON_UNESCAPED_UNICODE);
 | 
	
		
			
			|  | 459 | +
 | 
	
		
			
			| 444 | 460 |          // 防重解鎖
 | 
	
		
			
			| 445 | 461 |          $redis::del($rkey);
 | 
	
		
			
			| 446 | 462 |          
 |