From 024952312c6248307482f42fcc908987c53926c6 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 21 May 2014 03:07:37 +0000 Subject: [PATCH] added explicit sorting to getMyIssues() --- codepot/src/codepot/models/issuemodel.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/codepot/src/codepot/models/issuemodel.php b/codepot/src/codepot/models/issuemodel.php index 056d9628..93f52ca8 100644 --- a/codepot/src/codepot/models/issuemodel.php +++ b/codepot/src/codepot/models/issuemodel.php @@ -104,7 +104,6 @@ class IssueModel extends Model $this->db->trans_start (); if (strlen($userid) > 0) $this->db->where ('owner', $userid); - //$this->db->order_by ('id', 'desc'); if (is_array($filter)) { $this->db->where_in ('status', array_keys($filter)); @@ -115,6 +114,15 @@ class IssueModel extends Model $this->db->where ("updatedon >= SYSDATE() - INTERVAL {$hour_limit} HOUR"); } + if (strlen($userid) > 0) + { + $this->db->order_by ('id', 'desc'); + } + else + { + $this->db->order_by ('updatedon', 'desc'); + } + $query = $this->db->get ('issue'); $this->db->trans_complete ();