刮刮后端接口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.0 KiB

<?php
namespace app\command;
use app\logic\Zone;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\console\input\Option;
class Autousezone extends Command
{
protected function configure()
{
$this->setName('autousezone')
->setDescription('Description of Autousezone command')
->addOption('limit', null, Option::VALUE_REQUIRED , 'Description of --limit option')
->addOption('user_id', null, Option::VALUE_REQUIRED, 'Description of --user_id option')
->addOption('zone_goods_id', null, Option::VALUE_REQUIRED, 'Description of --zone_goods_id option');
}
protected function execute(Input $input, Output $output)
{
$limit = $input->getOption('limit');
$user_id = $input->getOption('user_id');
$zone_goods_id = $input->getOption('zone_goods_id');
// 处理您的代码逻辑,使用获取到的选项值
// 执行脚本逻辑
$output->writeln(Zone::auto($user_id,$zone_goods_id,$limit));
}
}