2022-07-23 17:07:13 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Console;
|
|
|
|
|
|
2024-07-03 11:51:23 +08:00
|
|
|
use App\Console\Commands\ChkOrderServer;
|
|
|
|
|
use App\Console\Commands\ChkPriceearly;
|
|
|
|
|
use App\Console\Commands\ChkReplenish;
|
|
|
|
|
use App\Console\Commands\ChkShelflife;
|
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;
|
2024-07-03 11:51:23 +08:00
|
|
|
use App\Models\StockNotice;
|
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;
|
2024-07-03 11:51:23 +08:00
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
|
use function RingCentral\Psr7\str;
|
2022-07-23 17:07:13 +08:00
|
|
|
|
|
|
|
|
class Kernel extends ConsoleKernel
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* The Artisan commands provided by your application.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
protected $commands = [
|
|
|
|
|
//
|
2024-07-03 11:51:23 +08:00
|
|
|
\App\Console\Commands\ChkReplenish::class,
|
2022-07-23 17:07:13 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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)
|
|
|
|
|
{
|
2024-07-03 11:51:23 +08:00
|
|
|
|
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-07-03 11:51:23 +08:00
|
|
|
// $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();
|
2024-03-15 16:58:25 +08:00
|
|
|
|
2024-07-03 11:51:23 +08:00
|
|
|
// $schedule->command('check:replenish')->everyMinute();
|
|
|
|
|
// $active_time=StockNotice::pluck('active_time');
|
|
|
|
|
$schedule->command(ChkReplenish::class);
|
|
|
|
|
$schedule->command(ChkOrderServer::class)->everyFifteenMinutes();
|
|
|
|
|
$schedule->command(ChkPriceearly::class)->everyFifteenMinutes();
|
|
|
|
|
$schedule->command(ChkShelflife::class)->everyFifteenMinutes();
|
|
|
|
|
// $schedule->command('check:priceearly')->dailyAt((string)$active_time[1]);
|
|
|
|
|
// $schedule->command('check:shelflife')->dailyAt((string)$active_time[2]);
|
|
|
|
|
// $schedule->command('check:orderServer')->everyFifteenMinutes();
|
2024-03-15 16:58:25 +08:00
|
|
|
|
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');
|
|
|
|
|
}
|
|
|
|
|
}
|