使用 codeigniter 显示 post 位于不同行的主图像
Display post's main image that is in a different row using codeigniter
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();
}
我正在尝试获取 codeigniter 中位于不同行的 post 主图像,并在我的视图中显示 post 信息,但如果图像行中有 2 个主图像,codeigniter 会向我显示具有相同内容和不同图像的副本 post
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 as firstimage, 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 as secondimage, 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();
}
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();
}
我正在尝试获取 codeigniter 中位于不同行的 post 主图像,并在我的视图中显示 post 信息,但如果图像行中有 2 个主图像,codeigniter 会向我显示具有相同内容和不同图像的副本 post
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 as firstimage, 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 as secondimage, 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();
}