當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Reservation::findFirst方法代碼示例

本文整理匯總了PHP中Reservation::findFirst方法的典型用法代碼示例。如果您正苦於以下問題:PHP Reservation::findFirst方法的具體用法?PHP Reservation::findFirst怎麽用?PHP Reservation::findFirst使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Reservation的用法示例。


在下文中一共展示了Reservation::findFirst方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: deleteAction

 public function deleteAction()
 {
     $this->view->disable();
     $this->response->setContentType('text/plain', 'UTF-8');
     $Reservationid = $this->request->get('reservationid', 'string');
     $reservation = Reservation::findFirst(array('coditions' => 'id=?1', 'bind' => array(1 => $reservationid)));
     if ($reservation != null) {
         $available = $reservation->Available;
         if ($available->date == date('Y-m-d', strtotime('now'))) {
             $this->response->setContent('對不起,該預約單已經超過可取消日期');
             $this->response->send();
             return;
         } else {
             if ($reservation->delete() == false) {
                 $this->response->setContent('對不起,現在無法取消預約單');
                 $this->response->send();
                 return;
             } else {
                 $this->response->setContent('預約單取消成功');
                 $this->response->send();
                 return;
             }
         }
     }
 }
開發者ID:sify21,項目名稱:guahao,代碼行數:25,代碼來源:HomeController.php

示例2: doprintAction

 public function doprintAction()
 {
     $rid = $this->request->get('reservationid', 'int');
     $r = Reservation::findFirst(array('id=:rid:', 'bind' => array('rid' => $rid)));
     $user = $r->getUser();
     $available = $r->getAvailable();
     $doctor = $available->getDoctor();
     $department = $doctor->getDepartment();
     $hospital = $department->getHospital();
     $this->view->setVars(array('user' => $user, 'available' => $available, 'doctor' => $doctor, 'department' => $department, 'hospital' => $hospital, 'reservation' => $r));
 }
開發者ID:sify21,項目名稱:guahao,代碼行數:11,代碼來源:OtherController.php

示例3: showsuccessAction

 public function showsuccessAction()
 {
     $availableid = $this->request->get('availableid', 'int');
     $this->tag->appendTitle('預約成功');
     $available = Available::findFirst(array('id=:id:', 'bind' => array('id' => $availableid)));
     $doctor = $available->getDoctor();
     $department = $doctor->getDepartment();
     $hospital = $department->getHospital();
     $user = User::findFirst(array('conditions' => 'id=?1', 'bind' => array(1 => $this->session->get('userid'))));
     $reservation = Reservation::findFirst(array('a_id=:a_id: AND u_id=:u_id:', 'bind' => array('a_id' => $available->id, 'u_id' => $user->id)));
     $this->view->setVars(array('doctor' => $doctor, 'hospital' => $hospital, 'department' => $department, 'reservationid' => $reservation->id, 'user' => $user, 'available' => $available));
 }
開發者ID:sify21,項目名稱:guahao,代碼行數:12,代碼來源:ReserveController.php


注:本文中的Reservation::findFirst方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。