diff --git a/app/Console/Commands/AutomaticallyStartActivity.php b/app/Console/Commands/AutomaticallyStartActivity.php index c2daa08..0b13b2d 100644 --- a/app/Console/Commands/AutomaticallyStartActivity.php +++ b/app/Console/Commands/AutomaticallyStartActivity.php @@ -53,13 +53,14 @@ class AutomaticallyStartActivity extends Command ->first(); $start = true; + $EventCalendarService = new EventCalendarService($this->logService); // 数据存在,且结束时间到了,结束时间 if ($runRes) { $end_time = $runRes['end_time']; $run_id = $runRes['id']; $is_manual = $runRes['is_manual']; if ($end_time && strtotime($end_time) <= $now_times) { - $this->updateStatus($run_id, 2); + $EventCalendarService->updateStatus($run_id, 2); } elseif ($is_manual == 1) { // 手动开始的不切换模式 $start = false; @@ -77,7 +78,6 @@ class AutomaticallyStartActivity extends Command ); })->orderBy('start_time') ->first(['id']); - $EventCalendarService = (new EventCalendarService($this->logService)); if ($res) { // 新活动运行 直接关闭旧活动 $new_id = $res['id'];