erp/app/Console/Kernel.php

51 lines
1.3 KiB
PHP
Raw Normal View History

2022-07-23 17:07:13 +08:00
<?php
namespace App\Console;
2024-02-04 17:20:06 +08:00
use App\Console\Commands\GoodsSkuDailyReport;
2022-08-10 16:39:25 +08:00
use App\Console\Commands\Inventory;
2022-07-23 17:07:13 +08:00
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use App\Console\Commands\KttOrderQuery;
2022-08-30 23:36:26 +08:00
use App\Console\Commands\DeleteKttQuery;
2022-07-23 17:07:13 +08:00
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
2022-08-30 23:36:26 +08:00
* @param \Illuminate\Console\Scheduling\Schedule $schedule
2022-07-23 17:07:13 +08:00
* @return void
*/
protected function schedule(Schedule $schedule)
{
2022-10-21 13:09:30 +08:00
// 服务器/etc/crontab添加cron入口
2023-06-01 20:09:59 +08:00
// * * * * * cd /home/wwwroot/erp.chutang66.com && php artisan schedule:run >> /dev/null 2>&1
2024-02-04 17:20:06 +08:00
$schedule->command(GoodsSkuDailyReport::class)->dailyAt('06:00');
2022-08-10 16:39:25 +08:00
$schedule->command(Inventory::class)->dailyAt('07:00');
$schedule->command(KttOrderQuery::class)->everyMinute();
2022-08-30 23:36:26 +08:00
$schedule->command(DeleteKttQuery::class)->daily();
2022-07-23 17:07:13 +08:00
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
2022-08-30 23:36:26 +08:00
$this->load(__DIR__ . '/Commands');
2022-07-23 17:07:13 +08:00
require base_path('routes/console.php');
}
}