Changeset 374 for pro-violet-viettel/sourcecode/application/modules/admin
- Timestamp:
- Nov 3, 2014 11:06:12 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php
r373 r374 46 46 function countCollaborator($data) { 47 47 $sql = "SELECT COUNT(id) as total FROM " . $this->table_name; 48 if (isset($data['keyword'])) { 49 $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') "; 48 if ($data['keyword']) { 49 if ($data['search_field'] == "cellphone") { 50 $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')"; 51 } else { 52 $sql.=" WHERE (full_name LIKE '%" . $data['keyword'] . "%' OR login_name LIKE '%" . $data['keyword'] . "%') "; 53 } 50 54 } 51 55 if (isset($this->db->query($sql)->row_array()['total'])) 56 { 52 57 return $this->db->query($sql)->row_array()['total']; 58 } 59 else 60 { 61 return 0; 62 } 53 63 } 54 64
Note: See TracChangeset
for help on using the changeset viewer.