|
@@ -37,12 +37,17 @@ class UserAccessLog extends UserAccessLogModel
|
|
return static::insert($data);
|
|
return static::insert($data);
|
|
}
|
|
}
|
|
|
|
|
|
- public static function getAccessLog($path, $from, $to, $page = 1, $size = 50)
|
|
|
|
|
|
+ public static function getAccessLog($path, $from, $to, $page = 1, $size = 50, $ip = '')
|
|
{
|
|
{
|
|
$m = self::where('create_time', '>=', $from)->where('create_time', '<=', $to);
|
|
$m = self::where('create_time', '>=', $from)->where('create_time', '<=', $to);
|
|
if (!empty($path)) {
|
|
if (!empty($path)) {
|
|
$m = $m->where('path', $path);
|
|
$m = $m->where('path', $path);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (!empty($ip)) {
|
|
|
|
+ $m = $m->where('ip', $ip);
|
|
|
|
+ }
|
|
|
|
+
|
|
$count = $m->count();
|
|
$count = $m->count();
|
|
$items = $m->page($page, $size)->select();
|
|
$items = $m->page($page, $size)->select();
|
|
|
|
|