* Fixed the issue of waterfall project stages being sorted in descending order by ID.

This commit is contained in:
hufangzhou
2023-08-28 14:38:12 +08:00
parent e7ff8e3b64
commit b7fa5788e0
+3 -3
View File
@@ -239,13 +239,13 @@ class projectModel extends model
->andWhere('status')->notin('done,closed')
->andWhere('deleted')->eq(0)
->orderBy($orderBy)
->fetchGroup('project');
->fetchGroup('project', 'id');
$this->app->loadClass('pager', $static = true);
foreach($projects as $projectID => $project)
{
$orderBy = $project->model == 'waterfall' ? 'id_asc' : 'id_desc';
$pager = $project->model == 'waterfall' ? null : new pager(0, 1, 1);
$project->model == 'waterfall' ? ksort($executions[$projectID]) : krsort($executions[$projectID]);
$project->executions = isset($executions[$projectID]) ? $executions[$projectID] : array();
$project->parentName = $projectParentNames[$project->id];
}