init
This commit is contained in:
34
application/command/QueryAgv.php
Normal file
34
application/command/QueryAgv.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace app\command;
|
||||
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
use think\Db;
|
||||
use think\Log;
|
||||
use app\api\controller\Task;
|
||||
|
||||
class QueryAgv extends Command
|
||||
{
|
||||
//配置定时器的信息
|
||||
protected function configure(){
|
||||
$this->setName('QueryAgv')->setDescription("计划任务QueryAgv");
|
||||
}
|
||||
|
||||
protected function execute(Input $input, Output $output){
|
||||
//输出到日志
|
||||
$output->writeln('Date Crontab job start...');
|
||||
/*** 这里写计划任务列表集 START ***/
|
||||
|
||||
$this->Work();
|
||||
|
||||
$output->writeln("Date Crontab job end...");
|
||||
}
|
||||
|
||||
private function Work(){
|
||||
|
||||
$task = new Task();
|
||||
$task->QueryAgv();
|
||||
echo("QUERYAGV---RUN---END\n");
|
||||
}
|
||||
}
|
||||
31
application/command/QueryStock.php
Normal file
31
application/command/QueryStock.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace app\command;
|
||||
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
use think\Db;
|
||||
use think\Log;
|
||||
use app\api\controller\Task;
|
||||
|
||||
class QueryStock extends Command
|
||||
{
|
||||
//配置定时器的信息
|
||||
protected function configure(){
|
||||
$this->setName('QueryStock')->setDescription("计划任务QueryStock");
|
||||
}
|
||||
|
||||
protected function execute(Input $input, Output $output){
|
||||
//输出到日志
|
||||
$output->writeln('Date Crontab job start...');
|
||||
/*** 这里写计划任务列表集 START ***/
|
||||
$this->Work();
|
||||
$output->writeln("Date Crontab job end...");
|
||||
}
|
||||
|
||||
private function Work(){
|
||||
$task = new Task();
|
||||
$task->QueryStock();
|
||||
echo("QUERYSTOCK---RUN---END\n");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user