Project model: join owner's name into project info

This commit is contained in:
Karsten Heiken
2011-08-01 13:17:03 +02:00
parent bf6981da8b
commit fe500af54b

View File

@@ -87,7 +87,11 @@ class Project extends CI_Model {
* Get all projects from the database.
*/
public function getAll() {
$result = $this->db->get('projects')->result_array();
$result = $this->db->select('projects.*, users.firstname AS `firstname`, users.lastname AS `lastname`')
->join('users', 'users.id = projects.owner', 'left')
->get('projects')->result_array();
return $result;
}