|
|
@@ -17,11 +17,13 @@ class CostGdt extends Command
|
|
|
/**
|
|
|
* 自定义脚本示例
|
|
|
* @return void
|
|
|
- * 用法 php webman cost:gdt 2025-07-30,2025-07-31 54970254,60853999
|
|
|
*/
|
|
|
protected function configure()
|
|
|
{
|
|
|
+ // 用法示例 php webman cost:gdt date api_id advertiser_ids
|
|
|
+ // php webman cost:gdt 2025-07-30,2025-07-31 0 54970254,60853999
|
|
|
$this->addArgument('date', InputArgument::OPTIONAL, '日期范围');
|
|
|
+ $this->addArgument('api_id', InputArgument::OPTIONAL, '需要拉取的API配置ID');
|
|
|
$this->addArgument('advertiser_ids', InputArgument::OPTIONAL, '需要拉取的广告账户');
|
|
|
}
|
|
|
|
|
|
@@ -33,7 +35,8 @@ class CostGdt extends Command
|
|
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
|
|
{
|
|
|
$date = $input->getArgument('date');
|
|
|
- $advertiser_ids = $input->getArgument('advertiser_ids');
|
|
|
+ $apiId = (int)$input->getArgument('api_id');
|
|
|
+ $advertiserIds = $input->getArgument('advertiser_ids');
|
|
|
|
|
|
$params = [];
|
|
|
|
|
|
@@ -41,13 +44,19 @@ class CostGdt extends Command
|
|
|
$params['date'] = explode(',', $date);
|
|
|
}
|
|
|
|
|
|
- if($advertiser_ids){
|
|
|
- $params['advertiser_ids'] = explode(',', $advertiser_ids);
|
|
|
+ if($apiId){
|
|
|
+ $params['api_id'] = $apiId;
|
|
|
}
|
|
|
|
|
|
+ if($advertiserIds){
|
|
|
+ $params['advertiser_ids'] = explode(',', $advertiserIds);
|
|
|
+ }
|
|
|
+
|
|
|
+ $output->writeln("\ngdt cost sta:" . json_encode($params, JSON_UNESCAPED_UNICODE));
|
|
|
+
|
|
|
$res = (new GdtCostHourLogic)->run($params);
|
|
|
|
|
|
- $output->writeln('gdt cost:' . $res);
|
|
|
+ $output->writeln("\ngdt cost end:" . $res);
|
|
|
|
|
|
return self::SUCCESS;
|
|
|
}
|