<?php namespace App\Console\Commands; use Illuminate\Console\Command; class CalcStock extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'calc:oosdays'; /** * The console command description. * * @var string */ public function __construct() { parent::__construct(); } } /** * Execute the console command. * * @return mixed */ public function handle() { $this->executeTs = Carbon::now()->timestamp; $executeDate = date('Y-m-d',$this->executeTs); $this->info('fetch date:'.$executeDate); $selectedOrganizationIds =1; foreach ($selectedOrganizationIds as $selectedOrganizationId) { $this->processFromList($selectedOrganizationId,$executeDate); } }
protected function processFrom(
$selectedOrganizationId,$executeDate){...}
命令运行 php artisan calc:oosdays