diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 6d436d70..680c06a2 100755 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -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();