Код: Выделить всё
public function get_post_info(){
$this->db->select('users.id as idautor,
users.first_name, post.active, post.id, post.titulo,
post.preco, post.user, post.data, post.img, post.conteudo');
$this->db->from('post');
$this->db->where('post.active',1);
$this->db->where('post.isf',0);
$this->db->join('users', 'users.id = post.user');
$this->db->limit(8);
$this->db->order_by('post.data','DESC');
return $this->db->get()->result();
}
public function get_post_photo(){
$this->db->select('users.id as idautor, users_pub_main_picture.url as url,
users.first_name, post.active, post.id, post.titulo,
post.preco, post.user, post.data, post.img, post.conteudo');
$this->db->from('post');
$this->db->where('post.active',1);
$this->db->where('post.isf',0);
$this->db->join('users', 'users.id = post.user');
$this->db->join('users_pub_main_picture', 'users_pub_main_picture.pub_id = post.id');
return $this->db->get()->result();
}
Подробнее здесь: https://stackoverflow.com/questions/579 ... odeigniter