fix(fsgx): 周期佣金锁与分销海报小程序码
- StoreOrderCreateServices: lockWrite 改为 lock(true),避免佣金计算整段异常 - QrcodeServices: 移除误加的 imageInfo 清空、补充小程序码失败日志 - UserBill getRoutineCode: 小程序码失败时回退为 H5 分享链接 ?spread=uid Made-with: Cursor
This commit is contained in:
@@ -1007,7 +1007,7 @@ class StoreOrderCreateServices extends BaseServices
|
||||
// 锁定推荐人行,确保同一推荐人同时只有一个事务在计算位次
|
||||
\think\facade\Db::name('user')
|
||||
->where('uid', $spread_uid)
|
||||
->lockWrite()
|
||||
->lock(true)
|
||||
->value('uid');
|
||||
|
||||
// fsgx B1:推荐人自己必须有报单商品订单,才能获得推荐返现佣金
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user