本文整理匯總了PHP中Patient::join方法的典型用法代碼示例。如果您正苦於以下問題:PHP Patient::join方法的具體用法?PHP Patient::join怎麽用?PHP Patient::join使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Patient
的用法示例。
在下文中一共展示了Patient::join方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: showAll
public function showAll()
{
$user = Confide::user();
$patients = Patient::join('user', 'user.id', '=', 'patient.user_id')->get();
if ($user->isStaff()) {
return View::make('home.patient.show-all', compact('user', 'patients'));
} else {
return Redirect::route('home.index');
}
}
示例2: showAll
public function showAll($requestID = null)
{
$user = Confide::user();
$patient = Patient::find($requestID);
$patient = Patient::join('user', 'user.id', '=', 'patient.user_id')->where('patient.user_id', '=', $user->id)->first();
if ($user->isStaff() && $requestID !== null) {
// If weare requesting a patient's appointments and we are Staff
$appointments = Appointment::where('patient_id', '=', $requestID)->get();
$patient = Patient::join('user', 'user.id', '=', 'patient.user_id')->where('patient.user_id', '=', $requestID)->first();
} else {
$appointments = Appointment::where('patient_id', '=', $user->id)->get();
}
foreach ($appointments as $appointment) {
$doctor = User::find($appointment->staff_id);
$appointment->doctor = $doctor->first_name . ' ' . $doctor->last_name;
}
return View::make('home/appointment/show-all', compact('user', 'appointments', 'patient'));
}