|
@@ -86,7 +86,8 @@ class LoginController extends Controller
|
|
|
}
|
|
}
|
|
|
if($onlyVerify)return true;
|
|
if($onlyVerify)return true;
|
|
|
|
|
|
|
|
- $user = GlobalUserInfo::getGameUserInfo("Phone", $Phone);
|
|
|
|
|
|
|
+ $config = RouteService::getChannelConfig($request);
|
|
|
|
|
+ $user = GlobalUserInfo::query()->where('RegionID', $config->isRegionUnique())->where("Phone", $Phone)->first();
|
|
|
if ($user) {
|
|
if ($user) {
|
|
|
$user = GlobalUserInfo::toWebData($user);
|
|
$user = GlobalUserInfo::toWebData($user);
|
|
|
return response()->json(apiReturnSuc($user, ['login.success', 'Login bem-sucedido, bem-vindo de volta!']));//->withCookie($this->setLoginCookie($user['sign']));
|
|
return response()->json(apiReturnSuc($user, ['login.success', 'Login bem-sucedido, bem-vindo de volta!']));//->withCookie($this->setLoginCookie($user['sign']));
|
|
@@ -138,20 +139,25 @@ class LoginController extends Controller
|
|
|
|
|
|
|
|
$verifyCode = GamePhoneVerityCode::verifyCode($Phone, $PhoneCode);
|
|
$verifyCode = GamePhoneVerityCode::verifyCode($Phone, $PhoneCode);
|
|
|
|
|
|
|
|
- //TODO 上线前去掉测试
|
|
|
|
|
if ($verifyCode != trim($PhoneCode)) {
|
|
if ($verifyCode != trim($PhoneCode)) {
|
|
|
SetNXLock::release($redisKey);
|
|
SetNXLock::release($redisKey);
|
|
|
Log::info("web.verify.code_incorrect_or_expired BindPhone $verifyCode",[$Phone,$PhoneCode]);
|
|
Log::info("web.verify.code_incorrect_or_expired BindPhone $verifyCode",[$Phone,$PhoneCode]);
|
|
|
return apiReturnFail(['web.verify.code_incorrect_or_expired', 'O código está incorreto ou o tempo passou']);
|
|
return apiReturnFail(['web.verify.code_incorrect_or_expired', 'O código está incorreto ou o tempo passou']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ $config = RouteService::getChannelConfig($request);
|
|
|
// 查看手机号是否已经绑定
|
|
// 查看手机号是否已经绑定
|
|
|
- $first = DB::connection('write')->table('QPAccountsDB.dbo.AccountPhone')
|
|
|
|
|
- ->where('PhoneNum', $Phone)
|
|
|
|
|
-// ->where('Channel', $user->Channel)
|
|
|
|
|
- ->orWhere('UserID', $user->UserID)
|
|
|
|
|
- ->first();
|
|
|
|
|
|
|
+// $first = DB::connection('write')->table('QPAccountsDB.dbo.AccountPhone')
|
|
|
|
|
+// ->where('PhoneNum', $Phone)
|
|
|
|
|
+//// ->where('Channel', $user->Channel)
|
|
|
|
|
+// ->orWhere('UserID', $user->UserID)
|
|
|
|
|
+ $first = GlobalUserInfo::query()->where(function ($query) use ($Phone, $user, $config) {
|
|
|
|
|
+ $query->where(function ($q) use ($Phone, $config) {
|
|
|
|
|
+ $q->where('RegionID', $config->isRegionUnique())->where('Phone', $Phone);
|
|
|
|
|
+ })->orWhere(function ($q) use ($user) {
|
|
|
|
|
+ $q->where('UserID', $user->UserID)->where('Phone', '<>', '');
|
|
|
|
|
+ });
|
|
|
|
|
+ })->first();
|
|
|
|
|
|
|
|
if ($first) {
|
|
if ($first) {
|
|
|
SetNXLock::release($redisKey);
|
|
SetNXLock::release($redisKey);
|
|
@@ -167,7 +173,7 @@ class LoginController extends Controller
|
|
|
|
|
|
|
|
$PhoneNum = $Phone;
|
|
$PhoneNum = $Phone;
|
|
|
|
|
|
|
|
- $Phone = $this->checkPhone($PhoneNum, $RegisterLocation);
|
|
|
|
|
|
|
+ $Phone = $this->checkPhone($PhoneNum, $RegisterLocation, $request);
|
|
|
//有错误返回
|
|
//有错误返回
|
|
|
if (is_array($Phone)){
|
|
if (is_array($Phone)){
|
|
|
Log::info(json_encode($Phone),[$Phone,$PhoneCode]);
|
|
Log::info(json_encode($Phone),[$Phone,$PhoneCode]);
|
|
@@ -181,8 +187,9 @@ class LoginController extends Controller
|
|
|
$BindDate = Carbon::now()->toDateTimeString();
|
|
$BindDate = Carbon::now()->toDateTimeString();
|
|
|
$LogonPass = $request->password??$PhoneCode;
|
|
$LogonPass = $request->password??$PhoneCode;
|
|
|
$Channel = $user->Channel;
|
|
$Channel = $user->Channel;
|
|
|
|
|
+ $RegionID = $user->RegionID;
|
|
|
// 绑定手机号
|
|
// 绑定手机号
|
|
|
- AccountPhone::insert(compact('UserID', 'PhoneNum', 'BindDate', 'Channel'));
|
|
|
|
|
|
|
+ AccountPhone::insert(compact('UserID', 'PhoneNum', 'BindDate', 'Channel','RegionID'));
|
|
|
GlobalUserInfo::where('GlobalUID', $user->GlobalUID)->update([ 'Phone' => $Phone, 'RegisterLocation' => $RegisterLocation]);
|
|
GlobalUserInfo::where('GlobalUID', $user->GlobalUID)->update([ 'Phone' => $Phone, 'RegisterLocation' => $RegisterLocation]);
|
|
|
Log::info('绑定手机号'.'-'.$user->GlobalUID.'-' . $Phone . '-' . $LogonPass . '-' . $UserID);
|
|
Log::info('绑定手机号'.'-'.$user->GlobalUID.'-' . $Phone . '-' . $LogonPass . '-' . $UserID);
|
|
|
// --绑定手机赠送金币
|
|
// --绑定手机赠送金币
|
|
@@ -196,7 +203,6 @@ class LoginController extends Controller
|
|
|
|
|
|
|
|
AgentService::recordPerformance($UserID, 0,1);
|
|
AgentService::recordPerformance($UserID, 0,1);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
SetNXLock::release($redisKey);
|
|
SetNXLock::release($redisKey);
|
|
|
return apiReturnSuc(GlobalUserInfo::getGameUserInfoToWeb('UserID', $UserID));
|
|
return apiReturnSuc(GlobalUserInfo::getGameUserInfoToWeb('UserID', $UserID));
|
|
|
/**
|
|
/**
|
|
@@ -269,7 +275,7 @@ class LoginController extends Controller
|
|
|
$user = $request->globalUser;
|
|
$user = $request->globalUser;
|
|
|
$user = GlobalUserInfo::toWebData($user);
|
|
$user = GlobalUserInfo::toWebData($user);
|
|
|
self::CheckTimeBonus($user);
|
|
self::CheckTimeBonus($user);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 计算VIP等级
|
|
// 计算VIP等级
|
|
|
//$user['vip'] = VipService::calculateVipLevel($user['UserID'] ?? 0);
|
|
//$user['vip'] = VipService::calculateVipLevel($user['UserID'] ?? 0);
|
|
|
|
|
|
|
@@ -741,14 +747,16 @@ class LoginController extends Controller
|
|
|
$type=$request->input('type','id');
|
|
$type=$request->input('type','id');
|
|
|
$FPID = $request->input("bfp", "");
|
|
$FPID = $request->input("bfp", "");
|
|
|
$user=null;
|
|
$user=null;
|
|
|
|
|
+
|
|
|
|
|
+ $config = RouteService::getChannelConfig($request);
|
|
|
if($type=='guest'){
|
|
if($type=='guest'){
|
|
|
//游客模式打开,随时可以登录
|
|
//游客模式打开,随时可以登录
|
|
|
//$user=GlobalUserInfo::where('FPID',$FPID)->where('Phone','')->where('Email','')->first();
|
|
//$user=GlobalUserInfo::where('FPID',$FPID)->where('Phone','')->where('Email','')->first();
|
|
|
- $user=GlobalUserInfo::where('FPID',$FPID)->first();
|
|
|
|
|
|
|
+ $user=GlobalUserInfo::where('FPID',$FPID)->where('RegionID',$config->isRegionUnique())->first();
|
|
|
if(!$user){
|
|
if(!$user){
|
|
|
return $this->registerUser($request);
|
|
return $this->registerUser($request);
|
|
|
}else{
|
|
}else{
|
|
|
- return $this->guestLogin($user);
|
|
|
|
|
|
|
+ return $this->guestLogin($user);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -763,11 +771,11 @@ class LoginController extends Controller
|
|
|
$RegisterLocation = $request->country ?? env('COUNTRY_CODE','55');
|
|
$RegisterLocation = $request->country ?? env('COUNTRY_CODE','55');
|
|
|
|
|
|
|
|
if (strstr($request->account, '@')) {
|
|
if (strstr($request->account, '@')) {
|
|
|
- $user = GlobalUserInfo::getGameUserInfo("Email", $request->account);
|
|
|
|
|
- } else if(is_numeric($request->account)){
|
|
|
|
|
- $user = GlobalUserInfo::getGameUserInfo("Phone", $RegisterLocation . $request->account);
|
|
|
|
|
- }else{
|
|
|
|
|
- $user = GlobalUserInfo::getGameUserInfo("Accounts", $request->account);
|
|
|
|
|
|
|
+ $user = GlobalUserInfo::query()->where('RegionID', $config->isRegionUnique())->where("Email", $request->account)->first();
|
|
|
|
|
+ } else if (is_numeric($request->account)) {
|
|
|
|
|
+ $user = GlobalUserInfo::query()->where('RegionID', $config->isRegionUnique())->where("Phone", $RegisterLocation . $request->account)->first();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $user = GlobalUserInfo::query()->where('RegionID', $config->isRegionUnique())->where("Accounts", $request->account)->first();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -813,7 +821,14 @@ class LoginController extends Controller
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!empty($Phone)) {
|
|
if (!empty($Phone)) {
|
|
|
- $isExist = GlobalUserInfo::query()->where("Phone", $Phone)->orWhere('Accounts',$OrgPhone)->first();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $config = RouteService::getChannelConfig($request);
|
|
|
|
|
+ $isExist = GlobalUserInfo::query()
|
|
|
|
|
+ ->where('RegionID', $config->isRegionUnique())
|
|
|
|
|
+ ->where(function ($query) use ($Phone, $OrgPhone) {
|
|
|
|
|
+ $query->where("Phone", $Phone)->orWhere('Accounts', $OrgPhone);
|
|
|
|
|
+ })
|
|
|
|
|
+ ->first();
|
|
|
//账户查重
|
|
//账户查重
|
|
|
if ($isExist) {
|
|
if ($isExist) {
|
|
|
if ($request&&Hash::check($request->password, $isExist->LogonPass)) {
|
|
if ($request&&Hash::check($request->password, $isExist->LogonPass)) {
|
|
@@ -831,9 +846,9 @@ class LoginController extends Controller
|
|
|
|
|
|
|
|
$accs=[];
|
|
$accs=[];
|
|
|
for($i=0;$i<100;$i++) {
|
|
for($i=0;$i<100;$i++) {
|
|
|
- $acc = $this->makeGustAccount();
|
|
|
|
|
|
|
+ $acc = $this->makeGuestAccount();
|
|
|
while(QuickAccountPassStore::where("account", $acc['account'])->exists()) {
|
|
while(QuickAccountPassStore::where("account", $acc['account'])->exists()) {
|
|
|
- $acc = $this->makeGustAccount();
|
|
|
|
|
|
|
+ $acc = $this->makeGuestAccount();
|
|
|
}
|
|
}
|
|
|
QuickAccountPassStore::create($acc);
|
|
QuickAccountPassStore::create($acc);
|
|
|
$accs[]=$acc;
|
|
$accs[]=$acc;
|
|
@@ -856,7 +871,7 @@ class LoginController extends Controller
|
|
|
}
|
|
}
|
|
|
return $acc->toArray();
|
|
return $acc->toArray();
|
|
|
}
|
|
}
|
|
|
- public function makeGustAccount()
|
|
|
|
|
|
|
+ public function makeGuestAccount()
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
// 词库
|
|
// 词库
|
|
@@ -865,20 +880,26 @@ class LoginController extends Controller
|
|
|
|
|
|
|
|
// 生成账号和密码
|
|
// 生成账号和密码
|
|
|
|
|
|
|
|
- $word1 = $words[array_rand($words)];
|
|
|
|
|
|
|
+ $word1 = $words[array_rand($words)];
|
|
|
// $word2 = $words[array_rand($words)];
|
|
// $word2 = $words[array_rand($words)];
|
|
|
- $number = str_pad($numbers[array_rand($numbers)], 2, '0', STR_PAD_LEFT);
|
|
|
|
|
|
|
+ $number = str_pad($numbers[array_rand($numbers)], 2, '0', STR_PAD_LEFT);
|
|
|
|
|
|
|
|
- $account= $word1 . $number ;
|
|
|
|
|
|
|
+ $account= $word1 . $number ;
|
|
|
|
|
|
|
|
- $word = $words[array_rand($words)];
|
|
|
|
|
- $number = str_pad($numbers[array_rand($numbers)], 2, '0', STR_PAD_LEFT);
|
|
|
|
|
- $password= $word . $number;
|
|
|
|
|
|
|
+ $word = $words[array_rand($words)];
|
|
|
|
|
+ $number = str_pad($numbers[array_rand($numbers)], 2, '0', STR_PAD_LEFT);
|
|
|
|
|
+ $password= $word . $number;
|
|
|
|
|
|
|
|
|
|
|
|
|
return compact('account', 'password');
|
|
return compact('account', 'password');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ public function getUserByFPID($FPID)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $user=GlobalUserInfo::getGameUserInfo('FPID', $FPID);
|
|
|
|
|
+ return $user;
|
|
|
}
|
|
}
|
|
|
private $maxFpsidLimit=2;
|
|
private $maxFpsidLimit=2;
|
|
|
public function registerUser(Request $request, $regByGuest = false)
|
|
public function registerUser(Request $request, $regByGuest = false)
|
|
@@ -917,9 +938,18 @@ class LoginController extends Controller
|
|
|
return apiReturnFail(['web.reg.fail_phone_exist', 'O número de telefone já existe, altere-o e tente se cadastrar novamente!']);
|
|
return apiReturnFail(['web.reg.fail_phone_exist', 'O número de telefone já existe, altere-o e tente se cadastrar novamente!']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ //获取默认配置
|
|
|
|
|
+ $config = RouteService::getChannelConfig($request);
|
|
|
|
|
+ //游客注册检查是否已经注册
|
|
|
if($type=='guest'){
|
|
if($type=='guest'){
|
|
|
- $guestUser=GlobalUserInfo::where('FPID',$FPID)->where('Phone','')->where('Email','')->first();
|
|
|
|
|
|
|
+ $where = [];
|
|
|
|
|
+ $where[] = ['FPID', $FPID];
|
|
|
|
|
+ $where[] = ['Phone', ''];
|
|
|
|
|
+ $where[] = ['Email', ''];
|
|
|
|
|
+ $where[] = ['RegionID', $config->isRegionUnique()];
|
|
|
|
|
+
|
|
|
|
|
+ $guestUser=GlobalUserInfo::where($where)->first();
|
|
|
|
|
+
|
|
|
if($guestUser){
|
|
if($guestUser){
|
|
|
//存在,直接返回去
|
|
//存在,直接返回去
|
|
|
return $this->guestLogin($guestUser);
|
|
return $this->guestLogin($guestUser);
|
|
@@ -962,9 +992,9 @@ class LoginController extends Controller
|
|
|
//保持邀请和被邀请的渠道序列统一
|
|
//保持邀请和被邀请的渠道序列统一
|
|
|
$ActCode = $request->input('act');
|
|
$ActCode = $request->input('act');
|
|
|
if(strstr($ActCode,'http')){
|
|
if(strstr($ActCode,'http')){
|
|
|
- $ActCode=explode('http',$ActCode)[0];
|
|
|
|
|
|
|
+ $ActCode=explode('http',$ActCode)[0];
|
|
|
}
|
|
}
|
|
|
- $Package = 'com.uswin.game777';
|
|
|
|
|
|
|
+
|
|
|
$ReferrType = 0;
|
|
$ReferrType = 0;
|
|
|
if ($ActCode) {
|
|
if ($ActCode) {
|
|
|
//使用邀请的Code来保持邀请被邀请的用户注册渠道一致性
|
|
//使用邀请的Code来保持邀请被邀请的用户注册渠道一致性
|
|
@@ -979,8 +1009,6 @@ class LoginController extends Controller
|
|
|
}
|
|
}
|
|
|
if(!$Channel){
|
|
if(!$Channel){
|
|
|
|
|
|
|
|
- //获取默认配置
|
|
|
|
|
- $config = RouteService::getChannelConfig($request);
|
|
|
|
|
//非游客注册
|
|
//非游客注册
|
|
|
while($config->isGuestOpen()&&!$regByGuest){
|
|
while($config->isGuestOpen()&&!$regByGuest){
|
|
|
RouteService::clearChannelConfig();
|
|
RouteService::clearChannelConfig();
|
|
@@ -1071,6 +1099,7 @@ class LoginController extends Controller
|
|
|
$globalUserInfo = new GlobalUserInfo([
|
|
$globalUserInfo = new GlobalUserInfo([
|
|
|
'UserID' => $UserID,
|
|
'UserID' => $UserID,
|
|
|
'GameID' => $GameID,
|
|
'GameID' => $GameID,
|
|
|
|
|
+ 'FF' => $request->input('ff', ''),
|
|
|
'FPID' => $FPID,
|
|
'FPID' => $FPID,
|
|
|
'LastFPID' => $FPID,
|
|
'LastFPID' => $FPID,
|
|
|
'ShortHashID' => $ShortHashID,
|
|
'ShortHashID' => $ShortHashID,
|
|
@@ -1086,6 +1115,7 @@ class LoginController extends Controller
|
|
|
'ServerRegion' => $ServerRegion,
|
|
'ServerRegion' => $ServerRegion,
|
|
|
'DefaultLanguage' => $Language,
|
|
'DefaultLanguage' => $Language,
|
|
|
'Channel' => $Channel??99,
|
|
'Channel' => $Channel??99,
|
|
|
|
|
+ 'RegionID' => $config->isRegionUnique(),
|
|
|
'ReferrType' => $ReferrType,
|
|
'ReferrType' => $ReferrType,
|
|
|
'RegisterDate' => date('Y-m-d H:i:s'),
|
|
'RegisterDate' => date('Y-m-d H:i:s'),
|
|
|
'InsurePass' => '',
|
|
'InsurePass' => '',
|
|
@@ -1110,8 +1140,8 @@ class LoginController extends Controller
|
|
|
Util::WriteLog('c99',json_encode($_SERVER));
|
|
Util::WriteLog('c99',json_encode($_SERVER));
|
|
|
}
|
|
}
|
|
|
//注册钱数要归0
|
|
//注册钱数要归0
|
|
|
- $newRegGolds=$config->isRegZeroMoneyOpen()?0:$config->BONUS_REG();
|
|
|
|
|
- GameScoreInfo::query()->where('UserID', $UserID)->update(['Score'=>$newRegGolds]);
|
|
|
|
|
|
|
+// $newRegGolds=$config->isRegZeroMoneyOpen()?0:$config->BONUS_REG();
|
|
|
|
|
+// GameScoreInfo::query()->where('UserID', $UserID)->update(['Score'=>$newRegGolds]);
|
|
|
|
|
|
|
|
$agentUser = AgentService::SetUserAgent($GlobalUID, $UserID, $ActCode);
|
|
$agentUser = AgentService::SetUserAgent($GlobalUID, $UserID, $ActCode);
|
|
|
SetNXLock::release($redisKey);
|
|
SetNXLock::release($redisKey);
|
|
@@ -1133,6 +1163,42 @@ class LoginController extends Controller
|
|
|
$guser['password'] = $password;
|
|
$guser['password'] = $password;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ $defaultGameId = 931;
|
|
|
|
|
+ $recommendGame = '/game/' . $defaultGameId;
|
|
|
|
|
+ // 如果用户信息存在,根据GameID的最后一位数字查询映射关系
|
|
|
|
|
+ if ($guser && isset($guser['GameID'])) {
|
|
|
|
|
+ $gameId = (string)$guser['GameID'];
|
|
|
|
|
+ $lastDigit = (int)substr($gameId, -1); // 获取最后一位数字
|
|
|
|
|
+
|
|
|
|
|
+ // 查询映射关系(带缓存)
|
|
|
|
|
+ $cacheKey = 'game_number_mapping:' . $lastDigit;
|
|
|
|
|
+ $mapping = null;
|
|
|
|
|
+ // 尝试从缓存获取
|
|
|
|
|
+ $cached = Redis::get($cacheKey);
|
|
|
|
|
+ if ($cached !== null) {
|
|
|
|
|
+ $decoded = json_decode($cached, true);
|
|
|
|
|
+ if (is_array($decoded) && !empty($decoded)) {
|
|
|
|
|
+ $mapping = (object)$decoded;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!$mapping){
|
|
|
|
|
+ $mapping = DB::table('agent.dbo.game_number_mapping')
|
|
|
|
|
+ ->where('number', $lastDigit)
|
|
|
|
|
+ ->first();
|
|
|
|
|
+
|
|
|
|
|
+ Redis::setex($cacheKey, $mapping ? 86400 : 300, json_encode($mapping ?: []));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($mapping && isset($mapping->game_id) && $mapping->game_id) {
|
|
|
|
|
+ $defaultGameId = $mapping->game_id;
|
|
|
|
|
+ $recommendGame = '/game/' . $mapping->game_id;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ $guser['recommendGame'] = $recommendGame;
|
|
|
|
|
+
|
|
|
|
|
+ AccountsInfo::where('UserID', $UserID)->update(['UserMedal' => $defaultGameId ]);
|
|
|
|
|
+
|
|
|
|
|
+ Util::WriteLog('register_params',[$request,$guser]);
|
|
|
|
|
|
|
|
return response()->json(apiReturnSuc($guser, ['reg.success', 'Registro realizado com sucesso!']));//->withCookie($this->setLoginCookie($guser['sign']));
|
|
return response()->json(apiReturnSuc($guser, ['reg.success', 'Registro realizado com sucesso!']));//->withCookie($this->setLoginCookie($guser['sign']));
|
|
|
}
|
|
}
|
|
@@ -1148,7 +1214,19 @@ class LoginController extends Controller
|
|
|
return apiReturnFail(['web.reg.fail_phone_exist', 'O número de telefone já existe, altere-o e tente se cadastrar novamente!']);
|
|
return apiReturnFail(['web.reg.fail_phone_exist', 'O número de telefone já existe, altere-o e tente se cadastrar novamente!']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $guestUser=GlobalUserInfo::where('FPID',$FPID)->first();
|
|
|
|
|
|
|
+// $guestUser=GlobalUserInfo::where('FPID',$FPID)->first();
|
|
|
|
|
+ $config = RouteService::getChannelConfig($request);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $where = [];
|
|
|
|
|
+ $where[] = ['FPID', $FPID];
|
|
|
|
|
+// $where[] = ['Phone', ''];
|
|
|
|
|
+// $where[] = ['Email', ''];
|
|
|
|
|
+ $where[] = ['RegionID', $config->isRegionUnique()];
|
|
|
|
|
+
|
|
|
|
|
+ $guestUser=GlobalUserInfo::where($where)->first();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if($guestUser){
|
|
if($guestUser){
|
|
|
//存在,直接返回去
|
|
//存在,直接返回去
|
|
|
return $this->guestLogin($guestUser);
|
|
return $this->guestLogin($guestUser);
|
|
@@ -1174,7 +1252,6 @@ class LoginController extends Controller
|
|
|
if(strstr($ActCode,'http')){
|
|
if(strstr($ActCode,'http')){
|
|
|
$ActCode=explode('http',$ActCode)[0];
|
|
$ActCode=explode('http',$ActCode)[0];
|
|
|
}
|
|
}
|
|
|
- $Package = 'com.uswin.game777';
|
|
|
|
|
$ReferrType = 0;
|
|
$ReferrType = 0;
|
|
|
if ($ActCode) {
|
|
if ($ActCode) {
|
|
|
//使用邀请的Code来保持邀请被邀请的用户注册渠道一致性
|
|
//使用邀请的Code来保持邀请被邀请的用户注册渠道一致性
|
|
@@ -1190,7 +1267,7 @@ class LoginController extends Controller
|
|
|
if(!$Channel){
|
|
if(!$Channel){
|
|
|
|
|
|
|
|
//获取默认配置
|
|
//获取默认配置
|
|
|
- $config = RouteService::getChannelConfig($request);
|
|
|
|
|
|
|
+// $config = RouteService::getChannelConfig($request);
|
|
|
//非游客注册
|
|
//非游客注册
|
|
|
// while($config->isGuestOpen()&&!$regByGuest){
|
|
// while($config->isGuestOpen()&&!$regByGuest){
|
|
|
// RouteService::clearChannelConfig();
|
|
// RouteService::clearChannelConfig();
|
|
@@ -1260,6 +1337,7 @@ class LoginController extends Controller
|
|
|
$globalUserInfo = new GlobalUserInfo([
|
|
$globalUserInfo = new GlobalUserInfo([
|
|
|
'UserID' => $UserID,
|
|
'UserID' => $UserID,
|
|
|
'GameID' => $GameID,
|
|
'GameID' => $GameID,
|
|
|
|
|
+ 'FF' => $request->input('ff', ''),
|
|
|
'FPID' => $FPID,
|
|
'FPID' => $FPID,
|
|
|
'LastFPID' => $FPID,
|
|
'LastFPID' => $FPID,
|
|
|
'ShortHashID' => $ShortHashID,
|
|
'ShortHashID' => $ShortHashID,
|
|
@@ -1274,7 +1352,8 @@ class LoginController extends Controller
|
|
|
'RegisterLocation' => $RegisterLocation,
|
|
'RegisterLocation' => $RegisterLocation,
|
|
|
'ServerRegion' => $ServerRegion,
|
|
'ServerRegion' => $ServerRegion,
|
|
|
'DefaultLanguage' => $Language,
|
|
'DefaultLanguage' => $Language,
|
|
|
- 'Channel' => $Channel??99,
|
|
|
|
|
|
|
+ 'Channel' => $Channel??100,
|
|
|
|
|
+ 'RegionID' => $config->isRegionUnique(),
|
|
|
'ReferrType' => $ReferrType,
|
|
'ReferrType' => $ReferrType,
|
|
|
'RegisterDate' => date('Y-m-d H:i:s'),
|
|
'RegisterDate' => date('Y-m-d H:i:s'),
|
|
|
'InsurePass' => '',
|
|
'InsurePass' => '',
|
|
@@ -1305,22 +1384,10 @@ class LoginController extends Controller
|
|
|
$agentUser = AgentService::SetUserAgent($GlobalUID, $UserID, $ActCode);
|
|
$agentUser = AgentService::SetUserAgent($GlobalUID, $UserID, $ActCode);
|
|
|
SetNXLock::release($redisKey);
|
|
SetNXLock::release($redisKey);
|
|
|
|
|
|
|
|
-// if ($regByGuest) {
|
|
|
|
|
-// return GlobalUserInfo::getGameUserInfo("UserID", $UserID);
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
$guser = GlobalUserInfo::toWebData($globalUserInfo,true);
|
|
$guser = GlobalUserInfo::toWebData($globalUserInfo,true);
|
|
|
|
|
|
|
|
-// if($agentUser->Higher1ID){
|
|
|
|
|
-// //获取邀请者信息
|
|
|
|
|
-// $inviter=AccountsInfo::where('UserID',$agentUser->Higher1ID)->first();
|
|
|
|
|
-// }
|
|
|
|
|
$guser['reg'] = 1;
|
|
$guser['reg'] = 1;
|
|
|
-//
|
|
|
|
|
-// if($type=='guest'){
|
|
|
|
|
-// $guser['account'] = $account;
|
|
|
|
|
-// $guser['password'] = $password;
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
$defaultGameId = 931;
|
|
$defaultGameId = 931;
|
|
|
$recommendGame = '/game/' . $defaultGameId;
|
|
$recommendGame = '/game/' . $defaultGameId;
|
|
@@ -1334,7 +1401,7 @@ class LoginController extends Controller
|
|
|
$cacheKey = 'game_number_mapping:' . $lastDigit;
|
|
$cacheKey = 'game_number_mapping:' . $lastDigit;
|
|
|
$mapping = null;
|
|
$mapping = null;
|
|
|
$cacheHit = false;
|
|
$cacheHit = false;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 尝试从缓存获取
|
|
// 尝试从缓存获取
|
|
|
$cached = Redis::get($cacheKey);
|
|
$cached = Redis::get($cacheKey);
|
|
|
if ($cached !== null) {
|
|
if ($cached !== null) {
|
|
@@ -1349,14 +1416,14 @@ class LoginController extends Controller
|
|
|
$mapping = null;
|
|
$mapping = null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 缓存未命中,查询数据库
|
|
// 缓存未命中,查询数据库
|
|
|
if (!$cacheHit) {
|
|
if (!$cacheHit) {
|
|
|
$mapping = DB::connection('write')
|
|
$mapping = DB::connection('write')
|
|
|
->table('agent.dbo.game_number_mapping')
|
|
->table('agent.dbo.game_number_mapping')
|
|
|
->where('number', $lastDigit)
|
|
->where('number', $lastDigit)
|
|
|
->first();
|
|
->first();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 存入缓存,24小时过期
|
|
// 存入缓存,24小时过期
|
|
|
if ($mapping) {
|
|
if ($mapping) {
|
|
|
Redis::setex($cacheKey, 86400, json_encode($mapping));
|
|
Redis::setex($cacheKey, 86400, json_encode($mapping));
|