「検索機能がおかしいです」

このコミットが含まれているのは:
守矢諏訪子 2021-12-25 14:21:32 +09:00
コミット 770fe6e6fd
1個のファイルの変更20行の追加6行の削除

ファイルの表示

@ -486,7 +486,10 @@ class MeetingsController extends Controller {
}
foreach ($list as $i => $l) {
if (null === (FatherRelation::select('id')->where('father_id', (int)$l->father_id)->where('child_id', (int)$r->child_id)->first())) {
if (null === ($rel = FatherRelation::select('id')->where('father_id', (int)$l->father_id)->where('child_id', (int)$r->child_id)->first())) {
continue;
}
if ($rel->child_id != (int)$rel->child_id) {
continue;
}
if (null === ($ma = MeetingApprovals::select('id')->where('child_id', (int)$r->child_id)->where('meeting_id', (int)$l->id)->whereNotNull('approval_at')->first())) {
@ -520,7 +523,10 @@ class MeetingsController extends Controller {
}
foreach ($list as $i => $l) {
if (null === (FatherRelation::select('id')->where('father_id', (int)$l->father_id)->where('child_id', (int)$r->child_id)->first())) {
if (null === ($rel = FatherRelation::select('id')->where('father_id', (int)$l->father_id)->where('child_id', (int)$r->child_id)->first())) {
continue;
}
if ($rel->child_id != (int)$rel->child_id) {
continue;
}
if (null === ($ma = MeetingApprovals::select('id')->where('child_id', (int)$r->child_id)->where('meeting_id', (int)$l->id)->whereNull('approval_at')->first())) {
@ -549,11 +555,15 @@ class MeetingsController extends Controller {
$child_select = ['image'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->where('father_id', (int)$r->father_id)->orderBy('updated_at', 'desc')->get())) {
$list = [];
if (null === ($list = Meeting::select($meeting_select)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->orderBy('updated_at', 'desc')->get())) {
return ['status_code' => 200, 'params' => $result];
}
foreach ($list as $i => $l) {
if ($l->father_id != (int)$r->father_id) {
continue;
}
if (null === ($l->approvals = MeetingApprovals::select($meeting_approvals_select)->whereNotNull('approval_at')->where('meeting_id', (int)$l->id)->get())) {
continue;
}
@ -596,11 +606,15 @@ class MeetingsController extends Controller {
$child_select = ['image'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->where('father_id', (int)$r->father_id)->orderBy('updated_at', 'desc')->get())) {
$list = [];
if (null === ($list = Meeting::select($meeting_select)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->orderBy('updated_at', 'desc')->get())) {
return ['status_code' => 200, 'params' => $result];
}
foreach ($list as $i => $l) {
if ($l->father_id != (int)$r->father_id) {
continue;
}
if (null === ($l->approvals = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$l->id)->get())) {
continue;
}