Use ActiveRecord for get() in project model

This commit is contained in:
Karsten Heiken
2011-05-08 20:07:11 +02:00
parent 45ee74d304
commit 516651f2e2

View File

@@ -92,8 +92,10 @@ class Project extends CI_Model {
*/ */
public function get($project_id) { public function get($project_id) {
$result = $this->db->get_where('projects', array('id' => $project_id))->row_array(); $result = $this->db->get_where('projects', array('id' => $project_id))->row_array();
$this->db->where('project', $project_id)->update('projects', array(
'lastaccess' => mysql_now(),
));
$this->db->query('UPDATE `projects` SET `lastaccess` = NOW() WHERE `id`='.$this->db->escape($project_id).';');
return $result; return $result;
} }