From b7fa5788e00e3ef0c1aa598617459b64739664ee Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 28 Aug 2023 14:38:12 +0800 Subject: [PATCH] * Fixed the issue of waterfall project stages being sorted in descending order by ID. --- module/project/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index c0fff97a1a..d5e3afcb1e 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -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]; }