ufutx.dma/app/Console/Commands/UpdateRestaurantDate.php
2026-03-04 14:42:40 +08:00

44 lines
999 B
PHP

<?php
namespace App\Console\Commands;
use App\Facades\CommonService;
use App\Models\MeetRoom;
use App\Models\MeetRoomReserve;
use App\Models\RestaurantDate;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
class UpdateRestaurantDate extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'update:restaurant:date';
/**
* The console command description.
*
* @var string
*/
protected $description = '当天修改日历';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$date = date('Y-m-d'); // 当前日期
$day_of_week = date('w', strtotime($date));
Log::info("update_restaurant_date:".$date."|week:".$day_of_week);
if ($day_of_week != 0) {
RestaurantDate::where('date',$date)->update(['status'=>0]);
}
return Command::SUCCESS;
}
}