table('QPAccountsDB.dbo.AccountsInfo')->where('UserID', $userId)->select('NickName')->first(); if (!$userInfo) { $this->error = 'Payment error_6'; return false; } // 购买礼包 $giftService = new FirstRechargeGifts(); $bool = $giftService->buyGifts($GiftsID, $userId); if ($bool === false) { $this->error = $giftService->getError(); return false; } if (!empty($GiftsID)) { $pay_amount = (int)DB::connection('write')->table('QPAccountsDB.dbo.FirstRechargeGifts')->where('GiftsID', $GiftsID)->first()->Price ?? 0; } if ($pay_amount < 0) { $this->error = 'Payment error_4'; return false; } return compact('user_name', 'email', 'pay_amount'); } }