erp/app/Console/Kernel.php
2024-08-07 16:00:36 +08:00

62 lines
1.9 KiB
PHP

<?php
namespace App\Console;
use App\Console\Commands\DailySalesReport;
use App\Console\Commands\GoodsSkuDailyReport;
use App\Console\Commands\Inventory;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use App\Console\Commands\KttOrderQuery;
use App\Console\Commands\DeleteKttQuery;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// 服务器/etc/crontab添加cron入口
// * * * * * cd /home/wwwroot/erp.yhr.life && php artisan schedule:run >> /dev/null 2>&1
$schedule->command(KttOrderQuery::class)->everyMinute();
$schedule->command(GoodsSkuDailyReport::class)->dailyAt('06:00');
$schedule->command(Inventory::class)->dailyAt('07:00');
$schedule->command(DailySalesReport::class, ['S1'])->dailyAt('12:00');
$schedule->command(DailySalesReport::class, ['S2'])->dailyAt('13:30');
$schedule->command(DailySalesReport::class, ['S3'])->dailyAt('15:00');
$schedule->command(DailySalesReport::class, ['S4'])->dailyAt('16:00');
$schedule->command(DailySalesReport::class, ['S5'])->dailyAt('17:30');
$schedule->command(DailySalesReport::class, ['S6'])->dailyAt('20:00');
$schedule->command(DailySalesReport::class, ['S7'])->dailyAt('09:30');
$schedule->command(DeleteKttQuery::class)->daily();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__ . '/Commands');
require base_path('routes/console.php');
}
}