40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
declare (strict_types=1);
|
|
|
|
namespace app\command;
|
|
|
|
use app\common\repositories\store\platformCommission\PartnerSettlementCycleRepository;
|
|
use think\console\Command;
|
|
use think\console\Input;
|
|
use think\console\input\Argument;
|
|
use think\console\Output;
|
|
use think\facade\Log;
|
|
|
|
class platformCommission extends Command{
|
|
protected function configure(){
|
|
// 指令配置
|
|
$this->setName('platformCommission')
|
|
->addArgument('run_type', Argument::OPTIONAL, "运行类型")
|
|
->setDescription('平台抽成相关任务');
|
|
}
|
|
|
|
protected function execute(Input $input,Output $output){
|
|
// 参数获取
|
|
$runType = trim($input->getArgument('run_type'));
|
|
$runType = $runType ?: '';
|
|
// 根据类型执行对应的操作
|
|
switch($runType){
|
|
// 合伙人佣金结算
|
|
case 'commission_partner_settlement':
|
|
Log::info('合伙人佣金结算 - 开始处理');
|
|
app()->make(PartnerSettlementCycleRepository::class)->settlementInit();
|
|
break;
|
|
default:
|
|
Log::info('平台抽成计划任务 - 错误 - 不明确的执行内容');
|
|
break;
|
|
}
|
|
// $output->writeln('接收参数:'. $runType);
|
|
// $output->writeln('success');
|
|
}
|
|
}
|