You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< ? php
namespace App\Console ;
use App\Models\Notifications ;
use App\Models\OrderItems ;
use App\Models\Orders ;
use App\Models\Refund ;
use Illuminate\Console\Scheduling\Schedule ;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel ;
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 )
{
//$schedule->command('inspire')->hourly();
$schedule -> command ( 'order-items:create-daily' ) -> everyMinute ();
$schedule -> command ( 'sync-recharge-pay-state:weixin' ) -> everyMinute ();
$schedule -> command ( 'sync-recharge-pay-state:alipay' ) -> everyMinute ();
//自动扣款, 下午两点开始扣款, 每小时可处理3000个子订单, 每天可以处理30000个子订单
$schedule -> call ( function () {
( new OrderItems ()) -> autoCheckout ();
}) -> everyMinute () -> timezone ( 'Asia/Shanghai' ) -> between ( '14:00' , '23:59' );
//自动退款
$schedule -> call ( function () {
( new Refund ()) -> autoRefund ();
}) -> everyMinute ();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands ()
{
$this -> load ( __DIR__ . '/Commands' );
require base_path ( 'routes/console.php' );
}
}