4 changed files with 153 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace app\command; |
||||
|
|
||||
|
use app\logic\Zone; |
||||
|
use think\console\Command; |
||||
|
use think\console\Input; |
||||
|
use think\console\Output; |
||||
|
|
||||
|
class Autousezone extends Command |
||||
|
{ |
||||
|
protected function configure() |
||||
|
{ |
||||
|
// 配置脚本命令的名称和描述 |
||||
|
$this->setName('Autousezone')->setDescription('自动完成刮奖脚本'); |
||||
|
} |
||||
|
|
||||
|
protected function execute(Input $input, Output $output) |
||||
|
{ |
||||
|
$count = $input->getOption('limit') ?? 500; |
||||
|
$user_id = $input->getOption('user_id') ?? 1; |
||||
|
$zone_goods_id = $input->getOption('zone_goods_id') ?? 1; |
||||
|
|
||||
|
// 执行脚本逻辑 |
||||
|
$output->writeln(Zone::auto($user_id,$zone_goods_id,$count)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
Loading…
Reference in new issue