|
|
@ -73,6 +73,8 @@ class UserService
|
|
|
|
'request_count' => 0,
|
|
|
|
'request_count' => 0,
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->doUserSource($data['user_id'], $gameId, $params['promote_id'] ?? 0, $deviceNum, $sdkVersion, $clientIp);
|
|
|
|
|
|
|
|
|
|
|
|
$this->resetLoginLimit();
|
|
|
|
$this->resetLoginLimit();
|
|
|
|
return ['status' => true, 'message' => '登录成功', 'data' => $data];
|
|
|
|
return ['status' => true, 'message' => '登录成功', 'data' => $data];
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -158,6 +160,27 @@ class UserService
|
|
|
|
return ['status' => true, 'message' => '登录成功', 'data' => $data];
|
|
|
|
return ['status' => true, 'message' => '登录成功', 'data' => $data];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function doUserSource($uid, $gameId, $promoteId, $deviceNum, $sdkVersion, $clientIp) {
|
|
|
|
|
|
|
|
$find = M('user_source', 'tab_')->where([
|
|
|
|
|
|
|
|
'user_id' => $uid,
|
|
|
|
|
|
|
|
'game_id' => $gameId,
|
|
|
|
|
|
|
|
'promote_id' => $promoteId
|
|
|
|
|
|
|
|
])->find();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$find) {
|
|
|
|
|
|
|
|
M('user_source', 'tab_')->add([
|
|
|
|
|
|
|
|
'user_id' => $uid,
|
|
|
|
|
|
|
|
'game_id' => $gameId,
|
|
|
|
|
|
|
|
'promote_id' => $promoteId,
|
|
|
|
|
|
|
|
'device_num' => $deviceNum,
|
|
|
|
|
|
|
|
'sdk_version' => $sdkVersion,
|
|
|
|
|
|
|
|
'ip' => $clientIp,
|
|
|
|
|
|
|
|
'create_time' => time()
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function isDeviceError($user, $testResource, $deviceNum)
|
|
|
|
protected function isDeviceError($user, $testResource, $deviceNum)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ($testResource && $user['device_number'] && $deviceNum && $user['device_number'] != $deviceNum) {
|
|
|
|
if ($testResource && $user['device_number'] && $deviceNum && $user['device_number'] != $deviceNum) {
|
|
|
|