This commit is contained in:
2023-11-20 02:42:54 +08:00
parent b929cae31e
commit 36f0588ef8
3 changed files with 25 additions and 4 deletions

View File

@@ -22,7 +22,7 @@ protected function schedule(Schedule $schedule): void
})->dailyAt('00:00');
$schedule->call(function () {
$future_post = Post::whereNotNull('published_at')->where('status', 'future')->where('published_at', '>=', now())->orderBy('published_at', 'ASC')->first();
$future_post = Post::whereNotNull('published_at')->where('status', 'future')->where('published_at', '<=', now())->orderBy('published_at', 'ASC')->first();
if (!is_null($future_post))
{