setName('shopro_wechat_trade:retry-failed') ->addOption('limit', null, Option::VALUE_OPTIONAL, 'Max rows', 50) ->setDescription('Retry failed WeChat trade sync records'); } protected function execute(Input $input, Output $output) { $limit = intval($input->getOption('limit') ?: 50); $count = (new WxShippingService())->retryFailed($limit); $output->writeln('Retried ' . $count . ' sync record(s).'); if ($count === 0) { $output->writeln('若无 pending/failed 记录,已成功同步的单需:php think shopro_wechat_trade:resync-shipping --sn=订单号'); $output->writeln('从未同步且已发货:php think shopro_wechat_trade:backfill --limit=100'); } } }