Files
zyt/server/app/command/QywxRefreshPromotionMedia.php
T
2026-08-31 15:17:34 +08:00

26 lines
700 B
PHP

<?php
declare(strict_types=1);
namespace app\command;
use app\common\service\qywx\QywxPromotionMediaService;
use think\console\Command;
use think\console\Input;
use think\console\Output;
class QywxRefreshPromotionMedia extends Command
{
protected function configure()
{
$this->setName('qywx:refresh-promotion-media')->setDescription('预热/刷新已保存欢迎语使用的三天临时素材');
}
protected function execute(Input $input, Output $output): int
{
$result = (new QywxPromotionMediaService())->refreshReferenced(100);
$output->writeln('QYWX_PROMOTION_MEDIA ' . json_encode($result));
return $result['failed'] > 0 ? 1 : 0;
}
}