#521 Search Node Date Range not working
This commit is contained in:
@@ -115,7 +115,7 @@ get '/ajax/content/report/ipinventory' => require_login sub {
|
|||||||
)->as_query;
|
)->as_query;
|
||||||
|
|
||||||
my $rs;
|
my $rs;
|
||||||
if ( $start && $end ) {
|
if ( $start and $end ) {
|
||||||
$start = $start . ' 00:00:00';
|
$start = $start . ' 00:00:00';
|
||||||
$end = $end . ' 23:59:59';
|
$end = $end . ' 23:59:59';
|
||||||
|
|
||||||
|
|||||||
@@ -27,35 +27,51 @@ ajax '/ajax/content/search/node' => require_login sub {
|
|||||||
my @active = (param('archived') ? () : (-bool => 'active'));
|
my @active = (param('archived') ? () : (-bool => 'active'));
|
||||||
|
|
||||||
my (@times, @wifitimes, @porttimes);
|
my (@times, @wifitimes, @porttimes);
|
||||||
if ($start and $end) {
|
if ( $start and $end ) {
|
||||||
$start = $start . ' 00:00:00';
|
$start = $start . ' 00:00:00';
|
||||||
$end = $end . ' 23:59:59';
|
$end = $end . ' 23:59:59';
|
||||||
|
|
||||||
if ($agenot) {
|
if ($agenot) {
|
||||||
@times = (-or => [
|
@times = (-or => [
|
||||||
time_first => [ { '<', $start }, undef ],
|
time_first => [ undef ],
|
||||||
time_last => { '>', $end },
|
time_last => [ { '<', $start }, { '>', $end } ]
|
||||||
]);
|
]);
|
||||||
@wifitimes = (-or => [
|
@wifitimes = (-or => [
|
||||||
time_last => { '<', $start },
|
time_first => [ undef ],
|
||||||
time_last => { '>', $end },
|
time_last => [ { '<', $start }, { '>', $end } ]
|
||||||
]);
|
]);
|
||||||
@porttimes = (-or => [
|
@porttimes = (-or => [
|
||||||
creation => { '<', $start },
|
creation => [ undef ],
|
||||||
creation => { '>', $end },
|
creation => [ { '<', $start }, { '>', $end } ]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@times = (-and => [
|
@times = (-or => [
|
||||||
time_first => { '>=', $start },
|
-and => [
|
||||||
time_last => { '<=', $end },
|
time_first => undef,
|
||||||
|
time_last => undef,
|
||||||
|
],
|
||||||
|
-and => [
|
||||||
|
time_last => { '>=', $start },
|
||||||
|
time_last => { '<=', $end },
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
@wifitimes = (-and => [
|
@wifitimes = (-or => [
|
||||||
time_last => { '>=', $start },
|
-and => [
|
||||||
time_last => { '<=', $end },
|
time_first => undef,
|
||||||
|
time_last => undef,
|
||||||
|
],
|
||||||
|
-and => [
|
||||||
|
time_last => { '>=', $start },
|
||||||
|
time_last => { '<=', $end },
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
@porttimes = (-and => [
|
@porttimes = (-or => [
|
||||||
creation => { '>=', $start },
|
creation => undef,
|
||||||
creation => { '<=', $end },
|
-and => [
|
||||||
|
creation => { '>=', $start },
|
||||||
|
creation => { '<=', $end },
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user