+ Clean actions for cron.

This commit is contained in:
tianshujie
2023-08-08 14:39:47 +08:00
parent afbe0e0dae
commit c51b538f99
2 changed files with 24 additions and 0 deletions
+11
View File
@@ -453,4 +453,15 @@ class action extends control
return true;
}
/**
* Clear dynamic records older than one month.
*
* @access public
* @return void
*/
public function cleanActions()
{
$this->action->cleanActions();
}
}
+13
View File
@@ -2394,4 +2394,17 @@ class actionModel extends model
$this->create($deletedAction->objectType, $deletedAction->objectID, 'undeleted');
}
}
/**
* Clear dynamic records older than one month.
*
* @access public
* @return void
*/
public function cleanActions()
{
$lastMonth = date('Y-m-d', strtotime('-1 month'));
$this->dao->delete()->from(TABLE_ACTIONLATEST)->where('date')->lt($lastMonth)->exec();
return !dao::isError();
}
}