Advertisement
jamboljack

Lowker Model

Dec 10th, 2014
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. function count_by_progdi($progdi_id) {     
  2.     $this->db->from('ft_lowker');
  3.     $this->db->where('progdi_id', $progdi_id);
  4.  
  5.     return $this->db->count_all_results();
  6. }
  7.  
  8. function select_all_id($limit = 6, $offset = 0, $progdi_id) {
  9.     $progdi_id = $this->uri->segment(3);
  10.  
  11.     $this->db->select('*');
  12.     $this->db->from('ft_lowker l');
  13.     $this->db->join('ft_users u', 'l.user_id = u.user_id');
  14.     $this->db->join('ft_progdi p', 'l.progdi_id = p.progdi_id');
  15.     $this->db->where('l.progdi_id', $progdi_id);
  16.     $this->db->limit($limit);
  17.         $this->db->offset($offset);
  18.     $this->db->order_by('l.lowker_tgl_post', 'desc');
  19.        
  20.     return $this->db->get();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement