|
@@ -78,19 +78,24 @@ class destination_delivery {
|
|
|
$term = $_POST['term'];
|
|
$term = $_POST['term'];
|
|
|
$term = trim($term);
|
|
$term = trim($term);
|
|
|
$station = $_REQUEST['station'];
|
|
$station = $_REQUEST['station'];
|
|
|
- $more_param = common::getInNotInSqlForSearch(utils::implode(';',$station));
|
|
|
|
|
|
|
+ $sqlwhere = '';
|
|
|
|
|
+ if(!empty($station)){
|
|
|
|
|
+ $more_param = common::getInNotInSqlForSearch(utils::implode(';',$station));
|
|
|
|
|
+ $sqlwhere = " and lower(e.contact_id) in ($more_param) ";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
$sql = "select e.email from public.ra_online_user r, employee e
|
|
$sql = "select e.email from public.ra_online_user r, employee e
|
|
|
where r.employee_id=e.employee_id
|
|
where r.employee_id=e.employee_id
|
|
|
and r.online_active = true
|
|
and r.online_active = true
|
|
|
and r.user_type = 'Employee'
|
|
and r.user_type = 'Employee'
|
|
|
and e.active = true
|
|
and e.active = true
|
|
|
- and lower(e.contact_id) in ($more_param)
|
|
|
|
|
|
|
+ ".$sqlwhere."
|
|
|
and coalesce(e.email,'') <>''
|
|
and coalesce(e.email,'') <>''
|
|
|
and e.email ilike '" . common::check_input($term) . "%' limit 20";
|
|
and e.email ilike '" . common::check_input($term) . "%' limit 20";
|
|
|
|
|
|
|
|
// $sql = "select email from public.ra_online_user where user_type = 'Employee' and lower(contact_id) in ($more_param)
|
|
// $sql = "select email from public.ra_online_user where user_type = 'Employee' and lower(contact_id) in ($more_param)
|
|
|
// and email ilike '" . common::check_input($term) . "%' limit 20";
|
|
// and email ilike '" . common::check_input($term) . "%' limit 20";
|
|
|
|
|
+ //error_log($sql);
|
|
|
$rs = common::excuteListSql($sql);
|
|
$rs = common::excuteListSql($sql);
|
|
|
$retData = array();
|
|
$retData = array();
|
|
|
foreach($rs as $key => $val){
|
|
foreach($rs as $key => $val){
|