Sync.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. namespace App\Http\Controllers\admin;
  3. use App\Http\Controllers\Controller;
  4. use App\Models\Collect;
  5. use App\Services\CollectService;
  6. use App\Services\RechargeService;
  7. use App\Services\RoomService;
  8. use App\Services\IssueService;
  9. use App\Services\ConfigService;
  10. use Google\Service\ServiceManagement\ConfigSource;
  11. class Sync extends Controller
  12. {
  13. public function collect()
  14. {
  15. $result = CollectService::syncCollectStay();
  16. return $this->success($result);
  17. }
  18. public function recharge()
  19. {
  20. $synced = RechargeService::syncPendingUsdtRechargeRecords();
  21. RechargeService::syncRechargeStay();
  22. // 代理 USDT 充值复用同一个外部定时任务,失败不影响会员充值同步结果。
  23. try {
  24. $synced['agent'] = app(\App\Services\Agent\AgentRechargeService::class)->sync();
  25. } catch (\Throwable $e) {
  26. report($e);
  27. }
  28. return $this->success($synced);
  29. }
  30. public function settle()
  31. {
  32. RoomService::noticeSettle();
  33. return $this->success();
  34. }
  35. public function five()
  36. {
  37. // IssueService::syncCountdownIssue(); // 提前20秒提醒
  38. // IssueService::syncCloseIssue(); // 同步停止
  39. // Log::error('✅ 获取到最新期号: ' . ($latestIssue ?? '无'));
  40. // 你的业务逻辑
  41. // IssueService::getLatestIssue2(); // 获取最新的期号
  42. // IssueService::syncCountdownIssue(); // 提前20秒提醒
  43. // IssueService::syncCloseIssue(); // 同步停止
  44. // Log::error('✅ 获取到最新期号: ' . ($latestIssue ?? '无'));
  45. // 你的业务逻辑
  46. $res = IssueService::getLatestIssue(); // 获取最新的期号
  47. return $this->success($res);
  48. }
  49. public function close()
  50. {
  51. IssueService::syncCountdownIssue(); // 提前20秒提醒
  52. IssueService::syncCloseIssue(); // 同步停止
  53. return $this->success();
  54. }
  55. public function cd()
  56. {
  57. IssueService::syncCountdownIssue(); //
  58. return $this->success();
  59. }
  60. public function exchange()
  61. {
  62. ConfigService::syncExchangeRate();
  63. return $this->success();
  64. }
  65. }