1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
class Notification_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getNotifData(){
$notifData = $this->db->query("SELECT * FROM notification_templates");
if(!empty($notifData)){
return $notifData->row();
}
return 0;
}
public function updateNotif($notifData = array()){
if(empty($notifData)){
return 0;
}
$status = $this->db->update('notification_templates',$notifData);
return $status;
}
public function getCityUsers($cities='',$view=''){
if(empty($cities)){
return 0;
}
$cond = ($view != '')?" USR.status IN ($view)":" USR.status!='2'";
$cond .= ($cities != '')?" AND CUST.city IN ($cities)":"";
$cityData = $this->db->query("SELECT CUST.* FROM customer AS CUST
INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
WHERE ".$cond);
if(!empty($cityData)){
return $cityData->result_array();
}
return 0;
}
}
?>