文件
xionggeshop/addons/shopro_wechat_trade/command/InitOrderPath.php

35 行
1.2 KiB
PHP

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<?php
namespace addons\shopro_wechat_trade\command;
use addons\shopro_wechat_trade\library\WxOrderPathService;
use think\console\Command;
use think\console\Input;
use think\console\Output;
class InitOrderPath extends Command
{
protected function configure()
{
$this->setName('shopro_wechat_trade:init-path')
->setDescription('Configure WeChat mini program order detail path');
}
protected function execute(Input $input, Output $output)
{
try {
$result = (new WxOrderPathService())->updatePath();
$output->writeln('Order detail path configured. errcode=0');
if (!empty($result['path'])) {
$output->writeln('path=' . $result['path']);
}
} catch (\Exception $e) {
$output->writeln('Failed: ' . $e->getMessage());
$output->writeln('');
$output->writeln('若 errcode=10060035:请先发布含 pages/order/detail 的小程序到微信线上/提审版,再重试。');
$output->writeln('发货同步(upload_shipping_info)不依赖本接口,可先配置发货管理并测试发货。');
$output->writeln('诊断: php think shopro_wechat_trade:probe-path');
}
}
}