このコミットが含まれているのは:
守矢諏訪子 2021-10-31 01:42:13 +09:00
コミット bfa0c997ff
1個のファイルの変更10行の追加13行の削除

ファイルの表示

@ -469,23 +469,20 @@ class MeetingsController extends Controller {
$child_select = ['image', 'last_name', 'first_name'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->where('id', $meeting_id)->where('father_id', (int)$r->father_id)->first())) {
if (null === ($result = Meeting::select($meeting_select)->where('id', $meeting_id)->where('father_id', (int)$r->father_id)->first())) {
return ['status_code' => 400];
}
foreach ($list as $i => $l) {
$result[] = $l;
if (null === ($result[$i]['meeting_image'] = MeetingImage::select($meeting_images_select)->where('meeting_id', (int)$l->id)->get())) {
return ['status_code' => 400];
}
if (null === ($result[$i]['approval'] = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$l->id)->whereNotNull('approval_at')->get())) {
return ['status_code' => 400];
}
if (null === ($result->meeting_image = MeetingImage::select($meeting_images_select)->where('meeting_id', (int)$result->id)->get())) {
return ['status_code' => 400];
}
if (null === ($result->approval = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$result->id)->whereNotNull('approval_at')->get())) {
return ['status_code' => 400];
}
foreach ($result[$i]['approval'] as $ii => $ra) {
if (null === ($result[$i]['approval'][$ii]['child'] = Child::select($child_select)->where('id', (int)$ra->child_id)->first())) {
return ['status_code' => 400];
}
foreach ($result->approval as $i => $r) {
if (null === ($result->approval[$i]['child'] = Child::select($child_select)->where('id', (int)$r->child_id)->first())) {
return ['status_code' => 400];
}
}