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