added explicit sorting to getMyIssues()

This commit is contained in:
hyung-hwan 2014-05-21 03:07:37 +00:00
parent 53455a7d0d
commit 024952312c

View File

@ -104,7 +104,6 @@ class IssueModel extends Model
$this->db->trans_start (); $this->db->trans_start ();
if (strlen($userid) > 0) $this->db->where ('owner', $userid); if (strlen($userid) > 0) $this->db->where ('owner', $userid);
//$this->db->order_by ('id', 'desc');
if (is_array($filter)) if (is_array($filter))
{ {
$this->db->where_in ('status', array_keys($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"); $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'); $query = $this->db->get ('issue');
$this->db->trans_complete (); $this->db->trans_complete ();