- Timestamp:
- Nov 3, 2014 12:25:15 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php
r369 r375 18 18 return $query->num_rows(); 19 19 } 20 21 function get_list_users($data) 22 { 23 $sql="SELECT * FROM ".$this->table_name; 24 $data['keyword']=''; 25 if ($data['keyword']) 26 { 27 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') "; 28 } 29 return $this->db->query($sql." ORDER BY us_id DESC LIMIT ".$data['start'].", ".$data['perpage']." ")->result_array(); 30 } 20 31 32 function get_total_users($data) 33 { 34 $sql="SELECT COUNT(".$this->id_name.") AS total FROM ".$this->table_name; 35 if (isset($data['keyword'])) 36 { 37 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%') "; 38 } 39 return $this->db->query($sql)->row_array()['total']; 40 } 21 41 }
Note: See TracChangeset
for help on using the changeset viewer.