|
|
@ -1098,7 +1098,7 @@ class UserModel extends Model{
|
|
|
|
$data["last_device_number"] = $user['device_number'];
|
|
|
|
$data["last_device_number"] = $user['device_number'];
|
|
|
|
$data["token"] = $this->generateToken($uid,$account,$password);
|
|
|
|
$data["token"] = $this->generateToken($uid,$account,$password);
|
|
|
|
|
|
|
|
|
|
|
|
$userToken = $this->generateToken($uid,$account,$password);
|
|
|
|
$userToken = $this->generateToken($uid,$account,$password).uniqid().rand(1000, 9999);
|
|
|
|
$relationGameId = M('game', 'tab_')->where([
|
|
|
|
$relationGameId = M('game', 'tab_')->where([
|
|
|
|
'id' => $game_id
|
|
|
|
'id' => $game_id
|
|
|
|
])->getField('relation_game_id');
|
|
|
|
])->getField('relation_game_id');
|
|
|
@ -1117,8 +1117,18 @@ class UserModel extends Model{
|
|
|
|
'create_time' => time(),
|
|
|
|
'create_time' => time(),
|
|
|
|
'update_time' => time()
|
|
|
|
'update_time' => time()
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
M('user_token', 'tab_')->where([
|
|
|
|
|
|
|
|
'user_id' => $uid,
|
|
|
|
|
|
|
|
'relation_game_id' => $relationGameId
|
|
|
|
|
|
|
|
])->save([
|
|
|
|
|
|
|
|
'user_token' => $userToken,
|
|
|
|
|
|
|
|
'login_cnt' => $userTokens['login_cnt'] + 1,
|
|
|
|
|
|
|
|
'update_time' => time()
|
|
|
|
|
|
|
|
]);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
M('user_token', 'tab_')->where([
|
|
|
|
M('user_token', 'tab_')->where([
|
|
|
|
|
|
|
|
'user_id' => $uid,
|
|
|
|
'game_id|relation_game_id' => $relationGameId
|
|
|
|
'game_id|relation_game_id' => $relationGameId
|
|
|
|
])->save([
|
|
|
|
])->save([
|
|
|
|
'user_token' => $userToken,
|
|
|
|
'user_token' => $userToken,
|
|
|
|