This commit is contained in:
songchenxuan
2023-07-19 03:33:23 +08:00
parent 9b32e98c33
commit 1dbee52ddb
6 changed files with 33 additions and 15 deletions
+6 -2
View File
@@ -1301,7 +1301,7 @@ class programModel extends model
* @access public
* @return void
*/
public function refreshStats()
public function refreshStats($refreshAll = false)
{
$updateTime = zget($this->app->config->global, 'projectStatsTime', '');
$now = helper::now();
@@ -1311,7 +1311,11 @@ class programModel extends model
* Else only refresh the latest executions in action table.
*/
$projects = array();
if($updateTime > date('Y-m-d', strtotime('-14 days')))
if($updateTime < date('Y-m-d', strtotime('-14 days')) or $refreshAll)
{
$projects = $this->dao->select('id,project,model')->from(TABLE_PROJECT)->fetchAll('id');
}
else
{
$projects = $this->dao->select('distinct t1.project,t2.model')->from(TABLE_ACTION)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')