Guest User

model

a guest
Jan 29th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. public function all_polling() {
  2. $this->db->select('*');
  3. $this->db->from('micom_pools');
  4. $this->db->limit(1);
  5. $this->db->where('status','published');
  6. $this->db->order_by('id','desc');
  7. $query = $this->db->get();
  8. return $query->result_array();
  9. }
  10.  
  11. public function polling_sum($id){
  12. $this->db->select('count(*) as jml_vote ');
  13. $this->db->from('micom_votes');
  14. $this->db->where('pool_id',$id);
  15. $query = $this->db->get();
  16. return $query->result_array();
  17.  
  18. }
  19.  
  20. public function jum_vote($id,$answer){
  21. $this->db->select('count(*) as jum');
  22. $this->db->from('micom_votes');
  23. $this->db->where(array('pool_id'=>$id,'answer_id'=>$answer));
  24. $query = $this->db->get();
  25. return $query->result_array();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment