修改用户合并

This commit is contained in:
luofei 2024-03-13 09:54:05 +08:00
parent eebb013e4e
commit 24e532f980

View File

@ -1729,8 +1729,8 @@ class Auth extends BaseController
UserRecharge::where('uid', $user['uid'])->update(['uid' => $targetUser['uid']]);
StoreOrderStatus::where('uid', $user['uid'])->update(['uid' => $targetUser['uid']]);
if ($user->now_money > 0) {
$user->now_money = 0;
$targetUser->now_money = bcadd($targetUser->now_money, $user->now_money, 2);
$user->now_money = 0;
$targetUser->save();
}
$merchant = Merchant::where('uid', $targetUser['uid'])->find();
@ -1767,10 +1767,9 @@ class Auth extends BaseController
$merchant->save();
}
}
if (!empty($user)) {
$user->wechat_user_id = 0;
$user->save();
}
$user->wechat_user_id = 0;
$user->main_uid = $targetUser['uid'];
$user->save();
Db::commit();
} catch (\Throwable $e) {
Db::rollback();