This commit is contained in:
hufangzhou
2023-06-02 13:45:13 +08:00
parent 02d81e3883
commit 3ff5cf2231
+5 -5
View File
@@ -638,11 +638,9 @@ class programModel extends model
*/
public function getProgressList($programIdList = array())
{
$programPairs = $this->getPairs();
$projectStats = $this->getProjectStats(0, 'all', 0, 'id_desc', null, 0, 0, true);
$programPairs = $this->getPairs();
$existProgramIdList = array_intersect($programIdList, array_keys($programPairs));
$existProjectIdList = array_intersect($programIdList, array_keys($projectStats));
$projectStats = $this->getProjectStats(0, 'all', 0, 'id_desc', null, 0, 0, true);
$totalProgress = array();
$projectCount = array();
@@ -656,7 +654,7 @@ class programModel extends model
$userPRJCount[$programID] = 0;
$progressList[$programID] = 0;
foreach($existProjectIdList as $projectID)
foreach($projectStats as $projectID => $project)
{
if(strpos($projectStats[$projectID]->path, ",{$programID},") === false) continue;
@@ -673,6 +671,8 @@ class programModel extends model
}
/* Add project progress. */
/* First calculate the overall progress of the program, and then filter the unqualified projects. */
$existProjectIdList = array_intersect($programIdList, array_keys($projectStats));
foreach($existProjectIdList as $projectID) $progressList[$projectID] = $projectStats[$projectID]->progress;
return $progressList;