fix delete logs

This commit is contained in:
Ibnu Maksum 2024-01-17 13:42:07 +07:00
parent c906d47674
commit 2d095aef08
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5

View File

@ -23,7 +23,7 @@ switch ($action) {
$q = (_post('q') ? _post('q') : _get('q')); $q = (_post('q') ? _post('q') : _get('q'));
$keep = _post('keep'); $keep = _post('keep');
if (!empty($keep)) { if (!empty($keep)) {
ORM::raw_execute("DELETE FROM tbl_logs WHERE date < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $keep DAY))"); ORM::raw_execute("DELETE FROM tbl_logs WHERE UNIX_TIMESTAMP(date) < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $keep DAY))");
r2(U . "logs/list/", 's', "Delete logs older than $keep days"); r2(U . "logs/list/", 's', "Delete logs older than $keep days");
} }
if ($q != '') { if ($q != '') {