perf: 优化节点后端获取用户用户列表接口响应速度,降低CPU使用资源

This commit is contained in:
xboard
2023-12-12 21:49:16 +08:00
parent 6d575649cf
commit 83957db37f
2 changed files with 30 additions and 1 deletions
+2 -1
View File
@@ -163,7 +163,8 @@ class ServerService
public function getAvailableUsers($groupId)
{
return User::whereIn('group_id', $groupId)
return \DB::table('v2_user')
->whereIn('group_id', $groupId)
->whereRaw('u + d < transfer_enable')
->where(function ($query) {
$query->where('expired_at', '>=', time())