fix(fsgx): 周期佣金锁与分销海报小程序码

- StoreOrderCreateServices: lockWrite 改为 lock(true),避免佣金计算整段异常
- QrcodeServices: 移除误加的 imageInfo 清空、补充小程序码失败日志
- UserBill getRoutineCode: 小程序码失败时回退为 H5 分享链接 ?spread=uid

Made-with: Cursor
This commit is contained in:
apple
2026-03-28 12:36:03 +08:00
parent ac696a8559
commit 35b6d76d50
4 changed files with 48 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ use crmeb\services\wechat\MiniProgram;
use crmeb\services\wechat\OfficialAccount;
use GuzzleHttp\Psr7\Utils;
use think\annotation\Inject;
use think\facade\Log;
use think\exception\ValidateException;
@@ -282,10 +283,12 @@ class QrcodeServices extends BaseServices
}
}
$siteUrl = sys_config('site_url');
$imageInfo = '';
if (!$imageInfo) {
$res = MiniProgram::appCodeUnlimit($data, $page, 280);
if (!$res) return false;
if (!$res) {
Log::error('[getRoutineQrcodePath] appCodeUnlimit 返回空, scene=' . $data . ', page=' . $page);
return false;
}
$uploadType = (int)sys_config('upload_type', 1);
$upload = UploadService::init($uploadType);
$res = (string)Utils::streamFor($res);
@@ -317,6 +320,7 @@ class QrcodeServices extends BaseServices
if ($imageInfo['image_type'] == 1) $url = $siteUrl . $url;
return $url;
} catch (\Throwable $e) {
Log::error('[getRoutineQrcodePath] 生成小程序码异常: ' . $e->getMessage());
return false;
}
}