35 行
1.2 KiB
PHP
35 行
1.2 KiB
PHP
<?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');
|
||
}
|
||
}
|
||
}
|