Пример #1
0
 public function lst()
 {
     $page = $this->page > 1 ? $this->page : 1;
     $limit = $this->limit > 0 ? $this->limit : \Yii::$app->params['limit'];
     $this->city_id = $this->city_id > 0 ? $this->city_id : null;
     if ($this->fnd != '') {
         $this->num = $this->fnd;
         $this->fnd = "%{$this->fnd}%";
     } else {
         $this->fnd = $this->num = null;
     }
     $sql = "Select lib_hosp.*,\n        lib_city.name as city_name, lib_oblast.name as oblast_name\n        from lib_hosp\n        join lib_city ON lib_hosp.city_id = lib_city.id\n        join lib_oblast ON lib_city.oblast_id = lib_oblast.id\n        where lib_hosp.active = 't'\n        and (lib_hosp.city_id=:city_id or :city_id is null)\n        and\n        (\n          UPPER(lib_hosp.name) LIKE UPPER (:fnd)\n          OR UPPER(lib_hosp.num) = UPPER (:fnd)\n          OR :fnd IS NULL\n        )\n        order by lib_hosp.name";
     $params = [];
     $params['fnd'] = $this->fnd;
     $params['num'] = $this->num;
     $params['city_id'] = $this->city_id;
     $ret = Core::execPage($sql, $params, $page, $limit);
     return $ret;
 }
Пример #2
0
 public function lst()
 {
     $page = $this->page > 1 ? $this->page : 1;
     $limit = $this->limit > 0 ? $this->limit : \Yii::$app->params['limit'];
     $this->hosp_id = $this->hosp_id > 0 ? $this->hosp_id : null;
     if ($this->fnd != '') {
         $this->fnd = "%{$this->fnd}%";
     } else {
         $this->fnd = null;
     }
     $sql = "Select auth.*, auth_mam.*,\n        lib_hosp.name as hosp_name, lib_city.name as city_name,\n        auth_doctor.name_f || auth_doctor.name_i || auth_doctor.name_o as doctor_name\n        from auth\n        join auth_mam ON auth.id = auth_mam.auth_id\n        left join lib_hosp on auth_mam.hosp_id=lib_hosp.id\n        left JOIN  lib_city on lib_hosp.city_id = lib_city.id\n        left join auth_doctor on auth_doctor.auth_id=auth_mam.doctor_id\n        where auth.active = 't'\n         and (auth_mam.hosp_id=:hosp_id or :hosp_id is null)\n        and\n        (\n          UPPER(auth_mam.email) LIKE UPPER (:fnd)\n          OR UPPER(auth_mam.name_f) LIKE UPPER (:fnd)\n          OR :fnd IS NULL\n        )\n        order by name_f";
     $params = [];
     $params['fnd'] = $this->fnd;
     $params['hosp_id'] = $this->hosp_id;
     $ret = Core::execPage($sql, $params, $page, $limit);
     return $ret;
 }
Пример #3
0
 public function lst()
 {
     $page = $this->page > 1 ? $this->page : 1;
     $limit = \Yii::$app->params['limit'];
     if ($this->fnd != '') {
         $this->fnd = "%{$this->fnd}%";
     } else {
         $this->fnd = null;
     }
     $sql = "Select auth.*, auth_adm.*\n        from auth\n        join auth_adm ON auth.id = auth_adm.auth_id\n        where auth.active = 't' and\n        (\n          UPPER(auth_adm.email) LIKE UPPER (:fnd)\n          OR UPPER(auth_adm.name_f) LIKE UPPER (:fnd)\n          OR :fnd IS NULL\n        )\n        order by auth_adm.name_f asc";
     $params = [];
     $params['fnd'] = $this->fnd;
     $ret = Core::execPage($sql, $params, $page, $limit);
     return $ret;
 }