feat(withdraw): 落地方案B一体化商城余额提现与手续费内扣模式,完善多端打款退款与对账闭环
这个提交包含在:
@@ -14,6 +14,8 @@ class Wechat
|
||||
protected $platform;
|
||||
// 转发服务
|
||||
protected $service;
|
||||
// 认证信息
|
||||
protected $oauthInfo;
|
||||
|
||||
public function __construct($platform, $payload = [])
|
||||
{
|
||||
@@ -26,6 +28,11 @@ class Wechat
|
||||
return $this->service->wechat;
|
||||
}
|
||||
|
||||
public function getOauthInfo()
|
||||
{
|
||||
return $this->oauthInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信登陆
|
||||
*
|
||||
@@ -40,6 +47,7 @@ class Wechat
|
||||
$this->registerOrBindUser($oauthInfo, 0, ['mobile' => $wechatUser['mobile'] ?? '']);
|
||||
|
||||
$oauthInfo->save();
|
||||
$this->oauthInfo = $oauthInfo;
|
||||
|
||||
$auth = Auth::instance();
|
||||
$ret = $auth->direct($oauthInfo->user_id);
|
||||
@@ -147,7 +155,21 @@ class Wechat
|
||||
if (!$user) {
|
||||
$oauthInfo->user_id = 0;
|
||||
} else {
|
||||
// 如果本次快捷登录提供了手机号,且用户原本没有手机号,则为用户补充手机号
|
||||
// 如果本次快捷登录提供了手机号
|
||||
if (!empty($extend['mobile'])) {
|
||||
// 若当前绑定账号手机号与快捷登录手机号不一致,检查系统是否已有该手机号用户
|
||||
if ($user->mobile !== $extend['mobile']) {
|
||||
$existingUser = UserModel::where('mobile', $extend['mobile'])->where('id', '<>', $user->id)->find();
|
||||
if ($existingUser) {
|
||||
// 将此微信第三方账号智能合并关联至已有该手机号的用户
|
||||
$oauthInfo->user_id = $existingUser->id;
|
||||
$oauthInfo->save();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果用户原本没有手机号,则为用户补充手机号
|
||||
$isChanged = false;
|
||||
if (!empty($extend['mobile']) && empty($user->mobile)) {
|
||||
$user->mobile = $extend['mobile'];
|
||||
|
||||
在新工单中引用
屏蔽一个用户