ShuanghongS hace 3 meses
padre
commit
21a938d726
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  1. 7 2
      service/destination_delivery.class.php

+ 7 - 2
service/destination_delivery.class.php

@@ -78,19 +78,24 @@ class destination_delivery {
             $term = $_POST['term'];
             $term = trim($term);
             $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 
                     where r.employee_id=e.employee_id 
                         and r.online_active = true
                         and r.user_type = 'Employee' 
                         and e.active = true
-                        and lower(e.contact_id) in ($more_param)
+                        ".$sqlwhere."
                         and coalesce(e.email,'') <>''
                         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)
             //     and email ilike '" . common::check_input($term) . "%' limit 20";
+            //error_log($sql);
             $rs = common::excuteListSql($sql);
             $retData = array();
             foreach($rs as $key => $val){