public function delete()
 {
     $where = 'id=' . $this->getId();
     return Application_Model_M_DepartmentsHospitalMap::delete($where);
 }
Exemplo n.º 2
0
 public static function RDelByHospitalID($hid)
 {
     Application_Model_M_Hospital::delById($hid);
     Application_Model_M_DestinationHospitalMap::delByHid($hid);
     Application_Model_M_DepartmentsHospitalMap::delByHid($hid);
 }
Exemplo n.º 3
0
 public function hospitalcancelAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $did = $this->_getParam('did');
     $hid = $this->_getParam('hid');
     try {
         Application_Model_M_DepartmentsHospitalMap::delByDidAndHid($did, $hid);
         $out['errno'] = "0";
     } catch (Zend_Db_Exception $e) {
         $out['errno'] = "1";
     }
     Yy_Utils::jsonOut($out);
 }
Exemplo n.º 4
0
 public function hospitalAction()
 {
     $id = $this->_getParam('id');
     //department_id
     $hospitalMaps = Application_Model_M_DepartmentsHospitalMap::fetchByDepartmentID($id);
     if (count($hospitalMaps) > 0) {
         $hospitals = array();
         foreach ($hospitalMaps as $hospitalMap) {
             $hospitalID = $hospitalMap->getHospital_id();
             $hospitalModel = Application_Model_M_Hospital::find($hospitalID);
             if ($hospitalModel && $hospitalModel->getStatus() == 1) {
                 $hospital = array('id' => $hospitalModel->getId(), 'name' => $hospitalModel->getName(), 'avatar' => Application_Model_M_Hospital::getAvatarUrl($hospitalModel->getId()), 'type' => $hospitalModel->getType(), 'departments' => $hospitalModel->getDepartments(), 'longitude' => $hospitalModel->getLongitude(), 'latitude' => $hospitalModel->getLatitude());
                 array_push($hospitals, $hospital);
             }
         }
         if (count($hospitals) > 0) {
             $out['errno'] = '0';
             $out['hospitals'] = $hospitals;
         } else {
             $out['errno'] = '1';
         }
     } else {
         $out['errno'] = '1';
     }
     $out['msg'] = Yy_ErrMsg_Costperf::getMsg('hospital', $out['errno']);
     Yy_Utils::jsonOut($out);
 }