赞
踩
一、首先编辑命令文件 Test.php
app\Console\Commands\Test\Test.php
<?php namespace App\Console\Commands\Test; use Illuminate\Console\Command; use Illuminate\Support\Facades\App; class Test extends Command { protected $signature = 'test:test {country}';//命令后面加上参数 protected $description = 'test:test'; public function __construct() { parent::__construct(); } public function handle() { $country = $this->argument('country');//获取命令参数 App::make('adminreport.org')->OrgSurveyScript($country);//将参数传入相应的调用方 return true; } }
二、其次编辑Kernel.php文件
app\Console\Kernel.php
<?php namespace App\Console; use Illuminate\Console\Scheduling\Schedule; use Laravel\Lumen\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel {
/** * The Artisan commands provided by your application. * *
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。