当前位置: 首页>>代码示例>>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;未经允许,请勿转载。