このコミットが含まれているのは:
守矢諏訪子 2021-11-06 19:11:25 +09:00
コミット b908d2d21a
1個のファイルの変更30行の追加28行の削除

ファイルの表示

@ -143,21 +143,22 @@ class MeetingsController extends Controller {
}
foreach ($approval as $a) {
if (null === ($list = Meeting::select($meeting_select)->where('id', (int)$a->meeting_id)->get())) {
$list = [];
}
foreach ($list as $i => $l) {
if (null === ($l->meeting_images = MeetingImage::select($meeting_images_select)->where('meeting_id', (int)$l->id)->get())) {
$l->meeting_images = [];
if (null !== ($list = Meeting::select($meeting_select)->where('id', (int)$a->meeting_id)->get())) {
foreach ($list as $i => $l) {
if (null === ($fr = FatherRelation::select('id')->where('father_id', (int)$l->father_id)->where('child_id', (int)$r->child_id)->first())) {
continue;
}
if (null === ($l->father = Father::select($father_select)->where('id', (int)$l->father_id)->first())) {
$l->father = new \stdClass();
}
if (null === ($l->meeting_images = MeetingImage::select($meeting_images_select)->where('meeting_id', (int)$l->id)->get())) {
$l->meeting_images = [];
}
if (null === ($l->meeting_approvals = MeetingApprovals::select($meeting_approvals_select)->whereNotNull('approval_at')->where('meeting_id', (int)$l->id)->first())) {
$l->meeting_approvals = new \stdClass();
}
$result[] = $l;
}
if (null === ($l->father = Father::select($father_select)->where('id', (int)$l->father_id)->first())) {
$l->father = new \stdClass();
}
if (null === ($l->meeting_approvals = MeetingApprovals::select($meeting_approvals_select)->whereNotNull('approval_at')->where('meeting_id', (int)$l->id)->orderBy('updated_at', 'desc')->get())) {
$l->meeting_approvals = [];
}
$result[] = $l;
}
}
@ -181,21 +182,22 @@ class MeetingsController extends Controller {
}
foreach ($approval as $a) {
if (null === ($list = Meeting::select($meeting_select)->where('id', (int)$a->meeting_id)->get())) {
$list = [];
}
foreach ($list as $i => $l) {
if (null === ($l->meeting_images = MeetingImage::select($meeting_images_select)->where('meeting_id', (int)$l->id)->get())) {
$l->meeting_images = [];
if (null !== ($list = Meeting::select($meeting_select)->where('id', (int)$a->meeting_id)->get())) {
foreach ($list as $i => $l) {
if (null === ($fr = FatherRelation::select('id')->where('father_id', (int)$l->father_id)->where('child_id', (int)$r->child_id)->first())) {
continue;
}
if (null === ($l->father = Father::select($father_select)->where('id', (int)$l->father_id)->first())) {
$l->father = new \stdClass();
}
if (null === ($l->meeting_images = MeetingImage::select($meeting_images_select)->where('meeting_id', (int)$l->id)->get())) {
$l->meeting_images = [];
}
if (null === ($l->meeting_approvals = MeetingApprovals::select($meeting_approvals_select)->whereNull('approval_at')->where('meeting_id', (int)$l->id)->first())) {
$l->meeting_approvals = new \stdClass();
}
$result[] = $l;
}
if (null === ($l->father = Father::select($father_select)->where('id', (int)$l->father_id)->first())) {
$l->father = new \stdClass();
}
if (null === ($l->meeting_approvals = MeetingApprovals::select($meeting_approvals_select)->whereNull('approval_at')->where('meeting_id', (int)$l->id)->orderBy('approval_at', 'asc')->get())) {
$l->meeting_approvals = [];
}
$result[] = $l;
}
}