步骤一:
在模块下面添加console文件夹:appplication--模块--console--ErpCrond.php
namespace app\kitchen\console; use think\console\Command; use think\console\Input; use think\console\Output; use think\console\Input\Argument; use app\kitchen\service\Erp as ErpService; class ErpCrond extends Command { const PAGE_SIZE = 5; private $className; private $command; private $option; public function __construct($name = null) { $this->className = get_class_name($this); parent::__construct($name); date_default_timezone_set('PRC'); } protected function configure() { $this->setName($this->className) ->addArgument('arg1', Argument::REQUIRED) ->addArgument('arg2', Argument::OPTIONAL); } protected function execute(Input $input, Output $output) { $arg = $input->getArguments(); $command =