* Fix bug for refreshStats and rename updateProcess to updateProgress.

This commit is contained in:
王怡栋
2024-04-28 17:30:03 +08:00
parent c886b631a6
commit c6d37dbecb
4 changed files with 7 additions and 6 deletions
+2 -1
View File
@@ -1339,6 +1339,7 @@ class programModel extends model
$projects = $this->dao->select('distinct t1.project,t2.model,t2.deleted')->from(TABLE_ACTION)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
->where('t1.`date`')->ge($updateTime)
->andWhere('t1.project')->ne(0)
->fetchAll('project');
if(empty($projects)) return;
}
@@ -1347,7 +1348,7 @@ class programModel extends model
$this->programTao->updateStats(array_keys($projects));
/* 2. Update programStatsTime. */
$this->programTao->updateProcess();
$this->programTao->updateProgress();
/* 3. Update projectStatsTime in config. */
$this->loadModel('setting')->setItem('system.common.global.projectStatsTime', $now);
+1 -1
View File
@@ -366,7 +366,7 @@ class programTao extends programModel
* @access protected
* @return bool
*/
protected function updateProcess(): bool
protected function updateProgress(): bool
{
$projectList = $this->dao->select('id,progress,path,consumed,`left`')->from(TABLE_PROJECT)
->where('type')->eq('project')
+2 -2
View File
@@ -547,9 +547,9 @@ class programTest
* @access public
* @return array
*/
public function updateProcessTest(): array
public function updateProgressTest(): array
{
$this->program->updateProcess();
$this->program->updateProgress();
if(dao::isError()) return dao::getError();
return $this->program->dao->select('*')->from(TABLE_PROJECT)->where('type')->eq('program')->fetchAll('id');
@@ -2,7 +2,7 @@
<?php
/**
title=测试 programTao::updateProcess();
title=测试 programTao::updateProgress();
timeout=0
cid=1
@@ -16,4 +16,4 @@ zdTable('user')->gen(5);
su('admin');
$programTester = new programTest();
r($programTester->updateProcessTest()) && p('1:progress') && e('0.00'); // 获取系统中所有项目集的进度
r($programTester->updateProgressTest()) && p('1:progress') && e('0.00'); // 获取系统中所有项目集的进度