本文整理汇总了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;
}
}
}
}
示例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));
}
示例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));
}