Changeset 20309 for events/phpframework/codeigniter/trunk/system/application/models/status_model.php
- Timestamp:
- 09/30/08 21:04:49 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/codeigniter/trunk/system/application/models/status_model.php
r20302 r20309 154 154 function get_last_comment($id) 155 155 { 156 $this->db->select('SQL_CALC_FOUND_ROWS statuses.comment ');156 $this->db->select('SQL_CALC_FOUND_ROWS statuses.comment, username AS reply_username'); 157 157 $this->db->from('statuses'); 158 $this->db->join('users AS u2', 'statuses.reply_user_id = u2.id', 'left'); 158 159 $this->db->where('user_id', $id); 159 $this->db->order_by(' created_at', 'DESC');160 $this->db->order_by('statuses.created_at', 'DESC'); 160 161 $this->db->limit(1, 0); 161 162 $query = $this->db->get(); … … 180 181 function get_comment($id) 181 182 { 182 $this->db->select(' statuses.id, username, comment, UNIX_TIMESTAMP(statuses.created_at) AS created_at,image');183 $this->db->select('SQL_CALC_FOUND_ROWS statuses.id, u1.username AS username, comment, u2.username AS reply_username, UNIX_TIMESTAMP(statuses.created_at) AS created_at, u1.image AS image'); 183 184 $this->db->from('statuses'); 184 $this->db->join('users', 'statuses.user_id = users.id', 'left'); 185 $this->db->join('users AS u1', 'statuses.user_id = u1.id', 'left'); 186 $this->db->join('users AS u2', 'statuses.reply_user_id = u2.id', 'left'); 185 187 $this->db->where('statuses.id', $id); 186 188 $this->db->limit(1, 0);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)