|
|
@@ -76,7 +76,7 @@ class GlobalUserInfo extends Model
|
|
|
'InsurePass', 'Gender', 'RegisterDate', 'RegisterIP',
|
|
|
'RegisterLocation', 'DefaultLanguage', 'ServerRegion',
|
|
|
'ThemeColor', 'Level', 'Exp', 'UserRight',
|
|
|
- 'SpreaderID', 'LastLogonIP', 'LastLogonDate', 'ReferrType','Channel','GpsAdid','FavoriteGames','PwaInstalled'
|
|
|
+ 'SpreaderID', 'LastLogonIP', 'LastLogonDate', 'ReferrType','Channel','GpsAdid','FavoriteGames','PwaInstalled','Registed'
|
|
|
];
|
|
|
|
|
|
// Attributes that should be cast to native types
|
|
|
@@ -131,7 +131,7 @@ class GlobalUserInfo extends Model
|
|
|
$data = false;
|
|
|
if ($user) {
|
|
|
$u = $user->toArray();
|
|
|
- $existKey = ['UserID', 'GameID', 'GlobalUID','Email', 'Phone','DefaultLanguage', 'NickName', 'FaceID', 'Gender', 'RegisterDate', 'RegisterLocation', 'InsurePass', 'Level', 'Exp', 'UserRight','Channel'];
|
|
|
+ $existKey = ['UserID', 'GameID', 'GlobalUID','Email', 'Phone','DefaultLanguage', 'NickName', 'FaceID', 'Gender', 'RegisterDate', 'RegisterLocation', 'InsurePass', 'Level', 'Exp', 'UserRight','Channel','Registed'];
|
|
|
$data = [];
|
|
|
foreach ($existKey as $key) {
|
|
|
$data[$key] = $u[$key];
|
|
|
@@ -144,7 +144,11 @@ class GlobalUserInfo extends Model
|
|
|
$user->GameID = $data['GameID'];
|
|
|
$user->update(['GameID' => $data['GameID']]);
|
|
|
}
|
|
|
- $data['Score'] = self::getScoreByUserID($data['UserID']);
|
|
|
+
|
|
|
+ $scoreData = self::getScoreDataByUserID($data['UserID']);
|
|
|
+
|
|
|
+ $data['Score'] = $scoreData($data['Score']);
|
|
|
+ $data['Score'] = $scoreData($data['Score']);
|
|
|
if($makeBB){
|
|
|
$data['bb']=['token'=>(new BetbyService())->getDefaultJWT($u)];
|
|
|
}
|
|
|
@@ -153,6 +157,9 @@ class GlobalUserInfo extends Model
|
|
|
return $data;
|
|
|
}
|
|
|
private static $userToScores=[];
|
|
|
+
|
|
|
+ private static $userToScoresData=[];
|
|
|
+
|
|
|
public static function getScoreByUserID($userID)
|
|
|
{
|
|
|
if(!isset(self::$userToScores[$userID])) {
|
|
|
@@ -163,6 +170,23 @@ class GlobalUserInfo extends Model
|
|
|
return self::$userToScores[$userID];
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public static function getScoreDataByUserID($userID)
|
|
|
+ {
|
|
|
+ if(!isset(self::$userToScoresData[$userID])) {
|
|
|
+ $scoreObj=GameScoreInfo::query()->select(['Score','InsureScore'])->where('UserID', $userID)->first();
|
|
|
+ if($scoreObj){
|
|
|
+ self::$userToScoresData[$userID]['Score'] = intval($scoreObj->Score) / NumConfig::NUM_VALUE;
|
|
|
+ self::$userToScoresData[$userID]['InsureScore'] = intval($scoreObj->InsureScore) / NumConfig::NUM_VALUE;
|
|
|
+ }else{
|
|
|
+ self::$userToScoresData[$userID]['Score'] = 0;
|
|
|
+ self::$userToScoresData[$userID]['InsureScore'] = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return self::$userToScoresData[$userID];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public static function GlobalToUserID($GlobalUID)
|
|
|
{
|
|
|
return intval(explode('-', $GlobalUID)[3]);
|