mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
improve IP Search getRecords()
This commit is contained in:
@@ -126,13 +126,12 @@ class IpSearch extends Page implements HasTable
|
|||||||
->whereRaw("iplog.ip = '{$filters['ip']['ip']}'")
|
->whereRaw("iplog.ip = '{$filters['ip']['ip']}'")
|
||||||
;
|
;
|
||||||
$total = $query->clone()->distinct()->count('iplog.userid');
|
$total = $query->clone()->distinct()->count('iplog.userid');
|
||||||
$records = $query->groupBy('iplog.userid')
|
if ($total > 0) {
|
||||||
->orderByDesc('ip_last_access')
|
$records = $query->groupBy('iplog.userid')
|
||||||
->forPage($page, $recordsPerPage)
|
->orderByDesc('ip_last_access')
|
||||||
->get()
|
->forPage($page, $recordsPerPage)
|
||||||
;
|
->get()
|
||||||
|
;
|
||||||
if ($records->isNotEmpty()) {
|
|
||||||
$userIdArr = $records->pluck('userid')->toArray();
|
$userIdArr = $records->pluck('userid')->toArray();
|
||||||
$ipCountResult = IpLog::query()
|
$ipCountResult = IpLog::query()
|
||||||
->whereIn('userid', $userIdArr)
|
->whereIn('userid', $userIdArr)
|
||||||
|
|||||||
Reference in New Issue
Block a user