[REFACTOR] 優化資料庫查詢效能:在多個 Service 與 Controller 中加入 select 欄位限制,並新增租戶資料表索引 Migration。
This commit is contained in:
@@ -16,7 +16,7 @@ class CoreService implements CoreServiceInterface
|
||||
*/
|
||||
public function getUsersByIds(array $ids): Collection
|
||||
{
|
||||
return User::whereIn('id', $ids)->get();
|
||||
return User::select('id', 'name')->whereIn('id', $ids)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ class CoreService implements CoreServiceInterface
|
||||
*/
|
||||
public function getAllUsers(): Collection
|
||||
{
|
||||
return User::all();
|
||||
return User::select('id', 'name')->get();
|
||||
}
|
||||
|
||||
public function ensureSystemUserExists()
|
||||
|
||||
Reference in New Issue
Block a user