Changeset 19973
- Timestamp:
- 09/26/08 21:30:55 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/codeigniter/trunk/system/application/models/user_model.php
r19449 r19973 14 14 $row = $query->row(); 15 15 return array($row->username, $row->image); 16 } 17 18 function get_username_and_image_by_username($username) 19 { 20 $this->db->select('id, username, image'); 21 $query = $this->db->get_where('users', array('username' => $username)); 22 return $query->row(); 16 23 } 17 24 … … 53 60 } 54 61 62 function get_friends_count($id) 63 { 64 $this->db->select('COUNT(*) AS count'); 65 $this->db->where('user_id', $id); 66 $query = $this->db->get('followers'); 67 $row = $query->row(); 68 return $row->count; 69 } 70 71 function get_followers_count($id) 72 { 73 $this->db->select('COUNT(*) AS count'); 74 $this->db->where('follow_id', $id); 75 $query = $this->db->get('followers'); 76 $row = $query->row(); 77 return $row->count; 78 } 79 55 80 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)