オブジェクト→配列

このコミットが含まれているのは:
守矢諏訪子 2021-11-13 13:16:03 +09:00
コミット f0fa618352
1個のファイルの変更11行の追加14行の削除

ファイルの表示

@ -236,15 +236,14 @@ class MeetingsController extends Controller {
return ['status_code' => 400];
}
foreach ($list as $i => $l) {
if (null !== ($l->approval = MeetingApprovals::select($meeting_approvals_select)->whereNotNull('approval_at')->where('meeting_id', (int)$l->id)->first())) {
if (null === ($l->approval->child = Child::select($child_select)->where('id', (int)$l->approval->child_id)->first())) {
$l->approval->child = new \stdClass();
if (null !== ($l->approval = MeetingApprovals::select($meeting_approvals_select)->whereNotNull('approval_at')->where('meeting_id', (int)$l->id)->get())) {
foreach ($l->approval as $ii => $ll) {
if (null === ($ll->child = Child::select($child_select)->where('id', (int)$ll->child_id)->first())) {
$ll->child = [];
}
}
}
else {
$l->approval = new \stdClass();
$l->approval->child = new \stdClass();
}
$result[] = $l;
}
@ -267,15 +266,13 @@ class MeetingsController extends Controller {
}
foreach ($list as $i => $l) {
if (null !== ($l->approval = MeetingApprovals::select($meeting_approvals_select)->whereNull('approval_at')->where('meeting_id', (int)$l->id)->first())) {
if (null === ($l->approval->child = Child::select($child_select)->where('id', (int)$l->approval->child_id)->first())) {
$l->approval->child = new \stdClass();
if (null !== ($l->approval = MeetingApprovals::select($meeting_approvals_select)->whereNull('approval_at')->where('meeting_id', (int)$l->id)->get())) {
foreach ($l->approval as $ii => $ll) {
if (null === ($ll->child = Child::select($child_select)->where('id', (int)$ll->child_id)->first())) {
$ll->child = [];
}
}
}
else {
$l->approval = new \stdClass();
$l->approval->child = new \stdClass();
}
$result[] = $l;
}