You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
590 B
24 lines
590 B
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Models\Activity;
|
|
use Illuminate\Console\Command;
|
|
|
|
class ActivitiesClearHotForEndedCommand extends Command
|
|
{
|
|
protected $signature = 'activities:clear-hot-ended';
|
|
|
|
protected $description = '将已结束活动的热门标记自动置为否(与日历「已结束」规则一致)';
|
|
|
|
public function handle(): int
|
|
{
|
|
$n = Activity::clearHotFlagsForEndedActivities();
|
|
if ($n > 0) {
|
|
$this->info("已将 {$n} 条已结束活动的热门标记取消。");
|
|
}
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|