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

ファイルの表示

@ -91,7 +91,7 @@ class MeetingsController extends Controller {
foreach ($result[$i]['approval'] as $j => $k) {
if (null === ($result[$i]['approval'][$j]['child'] = Child::select($child_select)->where('id', $k->child_id)->first())) {
return ['status_code' => 400];
$result[$i]['approval'][$j]['child'] = new \stdClass();
}
}
}
@ -154,8 +154,8 @@ class MeetingsController extends Controller {
if (null === ($l->meeting_images = MeetingImage::select($meeting_images_select)->where('meeting_id', (int)$l->id)->get())) {
$l->meeting_images = [];
}
if (null === ($l->approvals = MeetingApprovals::select($meeting_approvals_select)->whereNotNull('approval_at')->where('meeting_id', (int)$l->id)->first())) {
$l->approvals = new \stdClass();
if (null === ($l->approval = MeetingApprovals::select($meeting_approvals_select)->whereNotNull('approval_at')->where('meeting_id', (int)$l->id)->first())) {
$l->approval = new \stdClass();
}
$result[] = $l;
}
@ -193,8 +193,8 @@ class MeetingsController extends Controller {
if (null === ($l->meeting_images = MeetingImage::select($meeting_images_select)->where('meeting_id', (int)$l->id)->get())) {
$l->meeting_images = [];
}
if (null === ($l->approvals = MeetingApprovals::select($meeting_approvals_select)->whereNull('approval_at')->where('meeting_id', (int)$l->id)->first())) {
$l->approvals = new \stdClass();
if (null === ($l->approval = MeetingApprovals::select($meeting_approvals_select)->whereNull('approval_at')->where('meeting_id', (int)$l->id)->first())) {
$l->approval = new \stdClass();
}
$result[] = $l;
}
@ -220,17 +220,17 @@ class MeetingsController extends Controller {
}
foreach ($list as $i => $l) {
$result[] = $l;
if (null === ($result[$i]['approvals'] = MeetingApprovals::select($meeting_approvals_select)->whereNotNull('approval_at')->where('meeting_id', (int)$l->id)->orderBy('updated_at', 'desc')->get())) {
if (null === ($result[$i]['approval'] = MeetingApprovals::select($meeting_approvals_select)->whereNotNull('approval_at')->where('meeting_id', (int)$l->id)->orderBy('updated_at', 'desc')->get())) {
return ['status_code' => 400];
}
if (count($result[$i]['approvals']) == 0) {
if (count($result[$i]['approval']) == 0) {
unset($result[$i]);
continue;
}
foreach ($result[$i]['approvals'] as $ii => $ra) {
if (null === ($result[$i]['approvals'][$ii]['child'] = Child::select($child_select)->where('id', (int)$result[$i]['approvals'][$ii]['child_id'])->first())) {
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)$result[$i]['approval'][$ii]['child_id'])->first())) {
$result[$i]['approval'][$ii]['child'] = new \stdClass();
}
}
}
@ -255,17 +255,17 @@ class MeetingsController extends Controller {
foreach ($list as $i => $l) {
$result[] = $l;
if (null === ($result[$i]['approvals'] = MeetingApprovals::select($meeting_approvals_select)->whereNull('approval_at')->where('meeting_id', (int)$l->id)->orderBy('updated_at', 'desc')->get())) {
if (null === ($result[$i]['approval'] = MeetingApprovals::select($meeting_approvals_select)->whereNull('approval_at')->where('meeting_id', (int)$l->id)->orderBy('updated_at', 'desc')->get())) {
return ['status_code' => 400];
}
if (count($result[$i]['approvals']) > 1) {
if (count($result[$i]['approval']) > 1) {
unset($result[$i]);
continue;
}
foreach ($result[$i]['approvals'] as $ii => $ra) {
if (null === ($result[$i]['approvals'][$ii]['child'] = Child::select($child_select)->where('id', (int)$result[$i]['approvals'][$ii]['child_id'])->first())) {
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)$result[$i]['approval'][$ii]['child_id'])->first())) {
$result[$i]['approval'][$ii]['child'] = new \stdClass();
}
}
}
@ -289,13 +289,13 @@ class MeetingsController extends Controller {
}
foreach ($list as $i => $l) {
if (null === ($l->approvals = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$l->id)->orderBy('updated_at', 'desc')->get())) {
$l->approvals = [];
if (null === ($l->approval = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$l->id)->orderBy('updated_at', 'desc')->get())) {
$l->approval = [];
}
foreach ($l->approvals as $ii => $ra) {
if (null === ($l->approvals[$ii]['child'] = Child::select($child_select)->where('id', (int)$l->approvals[$ii]['child_id'])->first())) {
$l->approvals[$ii]['child'] = [];
foreach ($l->approval as $ii => $ra) {
if (null === ($l->approval[$ii]['child'] = Child::select($child_select)->where('id', (int)$l->approval[$ii]['child_id'])->first())) {
$l->approval[$ii]['child'] = [];
}
}
@ -321,13 +321,13 @@ class MeetingsController extends Controller {
}
foreach ($list as $i => $l) {
if (null === ($l->approvals = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$l->id)->orderBy('updated_at', 'desc')->get())) {
$l->approvals = [];
if (null === ($l->approval = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$l->id)->orderBy('updated_at', 'desc')->get())) {
$l->approval = [];
}
foreach ($l->approvals as $ii => $ra) {
if (null === ($l->approvals[$ii]['child'] = Child::select($child_select)->where('id', (int)$l->approvals[$ii]['child_id'])->first())) {
$l->approvals[$ii]['child'] = [];
foreach ($l->approval as $ii => $ra) {
if (null === ($l->approval[$ii]['child'] = Child::select($child_select)->where('id', (int)$l->approval[$ii]['child_id'])->first())) {
$l->approval[$ii]['child'] = [];
}
}
@ -413,13 +413,13 @@ class MeetingsController extends Controller {
if (null === ($l->meeting_image = MeetingImage::select($meeting_images_select)->where('meeting_id', (int)$l->id)->get())) {
$l->meeting_image = [];
}
if (null === ($l->meeting_approvals = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$l->id)->whereNull('approval_at')->get())) {
$l->meeting_approvals = [];
if (null === ($l->approval = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$l->id)->whereNull('approval_at')->first())) {
$l->approval = new \stdClass();
}
foreach ($l->meeting_approvals as $ii => $ra) {
if (null == ($l->meeting_approvals[$ii]['child'] = Child::select($child_select)->where('id', (int)$result[$i]['meeting_approvals'][$ii]['child_id'])->first())) {
$l->meeting_approvals[$ii]['child'] = [];
foreach ($l->approval as $ii => $ra) {
if (null == ($result[$i]['approval'][$ii]['child'] = Child::select($child_select)->where('id', (int)$result[$i]['approval'][$ii]['child_id'])->first())) {
$result[$i]['approval'][$ii]['child'] = [];
}
}
@ -449,13 +449,13 @@ class MeetingsController extends Controller {
if (null === ($l->meeting_image = MeetingImage::select($meeting_images_select)->where('meeting_id', (int)$l->id)->get())) {
$l->meeting_image = [];
}
if (null === ($l->meeting_approvals = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$l->id)->whereNotNull('approval_at')->get())) {
$l->meeting_approvals = [];
if (null === ($l->approval = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$l->id)->whereNotNull('approval_at')->first())) {
$l->approval = new \stdClass();
}
foreach ($l->meeting_approvals as $ii => $ra) {
if (null == ($l->meeting_approvals[$ii]['child'] = Child::select($child_select)->where('id', (int)$result[$i]['meeting_approvals'][$ii]['child_id'])->first())) {
$l->meeting_approvals[$ii]['child'] = [];
foreach ($l->approval as $ii => $ra) {
if (null == ($result[$i]['approval'][$ii]['child'] = Child::select($child_select)->where('id', (int)$result[$i]['approval'][$ii]['child_id'])->first())) {
$result[$i]['approval'][$ii]['child'] = [];
}
}
@ -507,7 +507,7 @@ class MeetingsController extends Controller {
foreach ($result->approval as $i => $a) {
if (null === ($result->approval[$i]['child'] = Child::select($child_select)->where('id', (int)$a->child_id)->first())) {
$result->approval[$i]['child'] = [];
$result->approval[$i]['child'] = new \stdClass();
}
}
}