2022-07-23 17:07:13 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Console;
|
|
|
|
|
|
2024-03-15 16:58:25 +08:00
|
|
|
use App\Console\Commands\DailySalesReport;
|
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;
|
2022-08-30 15:49:15 +08:00
|
|
|
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入口
|
2024-08-07 16:00:36 +08:00
|
|
|
// * * * * * cd /home/wwwroot/erp.yhr.life && php artisan schedule:run >> /dev/null 2>&1
|
2024-03-15 16:58:25 +08:00
|
|
|
$schedule->command(KttOrderQuery::class)->everyMinute();
|
|
|
|
|
|
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');
|
2024-03-15 16:58:25 +08: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');
|
|
|
|
|
|
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');
|
|
|
|
|
}
|
|
|
|
|
}
|