Files
zyt/server/app/command/QywxSyncPromotionRanges.php
2026-08-25 10:45:24 +08:00

34 lines
908 B
PHP

<?php
declare(strict_types=1);
namespace app\command;
use app\common\service\qywx\QywxPromotionRangeSyncService;
use think\console\Command;
use think\console\Input;
use think\console\Output;
/** 重算并重试尚未同步到企业微信的获客链接多人范围。 */
class QywxSyncPromotionRanges extends Command
{
protected function configure()
{
$this->setName('qywx:sync-promotion-ranges')
->setDescription('同步企业微信官方获客链接的多人路由成员范围');
}
protected function execute(Input $input, Output $output): int
{
$result = (new QywxPromotionRangeSyncService())->syncPending(100);
$output->writeln(sprintf(
'QYWX_PROMOTION_RANGE_SYNC selected=%d synced=%d failed=%d',
$result['selected'],
$result['synced'],
$result['failed']
));
return 0;
}
}