Browse Source

修改同步的

seven 5 days ago
parent
commit
6899546684
3 changed files with 13 additions and 1 deletions
  1. 12 0
      app/Http/Controllers/admin/Sync.php
  2. 0 1
      app/Jobs/FiveSecondTaskJob.php
  3. 1 0
      routes/admin.php

+ 12 - 0
app/Http/Controllers/admin/Sync.php

@@ -7,6 +7,8 @@ use App\Models\Collect;
 use App\Services\CollectService;
 use App\Services\RechargeService;
 use App\Services\RoomService;
+use App\Services\IssueService;
+
 
 class Sync extends Controller 
 {
@@ -28,4 +30,14 @@ class Sync extends Controller
         RoomService::noticeSettle();
         return $this->success();
     }
+
+    public function five()
+    {
+        IssueService::syncCloseIssue(); // 同步停止
+        // Log::error('✅ 获取到最新期号: ' . ($latestIssue ?? '无'));
+
+        // 你的业务逻辑
+        IssueService::getLatestIssue(); // 获取最新的期号
+        return $this->success();
+    }
 }

+ 0 - 1
app/Jobs/FiveSecondTaskJob.php

@@ -43,7 +43,6 @@ class FiveSecondTaskJob implements ShouldQueue
      */
     public function handle()
     {
-        file_put_contents(storage_path('logs/test_job.log'), now() . " 执行任务\n", FILE_APPEND);
         try {
             Log::error('🚀 开始执行5秒任务: ' . now());
             

+ 1 - 0
routes/admin.php

@@ -26,6 +26,7 @@ Route::prefix('/sync')->group(function () {
     Route::get('/collect', [Sync::class, 'collect']);
     Route::get('/recharge', [Sync::class, 'recharge']);
     Route::get('/settle', [Sync::class, 'settle']);
+    Route::get('/five', [Sync::class, 'five']);
 });