Fix date range to filter suspcicious accounts and possible affected users

This commit is contained in:
Champ Camba
2023-07-07 17:37:43 +08:00
parent bd14db9e68
commit 3ca3d0c0e8
2 changed files with 8 additions and 6 deletions
+5 -3
View File
@@ -82,15 +82,17 @@ if ( ! class_exists( 'um\admin\Secure' ) ) {
$query->set(
'date_query',
array(
'after' => human_time_diff( $date_from, strtotime( current_time( 'mysql' ) ) ) . ' ago',
'after' => human_time_diff( $date_from, strtotime( current_time( 'mysql' ) ) ) . ' ago',
'inclusive' => true,
)
);
} elseif ( $date_from && $date_to ) {
$query->set(
'date_query',
array(
'after' => human_time_diff( $date_from, strtotime( current_time( 'mysql' ) ) ) . ' ago',
'before' => human_time_diff( $date_to, strtotime( current_time( 'mysql' ) ) ) . ' ago',
'after' => human_time_diff( $date_from, strtotime( current_time( 'mysql' ) ) ) . ' ago',
'before' => human_time_diff( $date_to, strtotime( current_time( 'mysql' ) ) ) . ' ago',
'inclusive' => true,
)
);
}
+3 -3
View File
@@ -218,12 +218,12 @@ class Secure {
'number' => -1,
'exclude' => $arr_suspected_accounts,
'date_query' => array(
'after' => gmdate( 'F d, Y', $oldest_date ),
'before' => gmdate( 'F d, Y', $newest_date ),
'inclusive' => true,
'after' => gmdate( 'F d, Y', strtotime( '-1 day', $oldest_date ) ),
'before' => gmdate( 'F d, Y', strtotime( '+1 day', $newest_date ) ),
),
)
);
}
/**