Merge pull request #196 from nakazawakan/backend

「子の本登録時にID自動付与機能」
このコミットが含まれているのは:
chankan77 2021-12-23 21:06:27 +09:00 committed by GitHub
コミット b06adb3977
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 4AEE18F83AFDEB23
3個のファイルの変更15行の追加15行の削除

ファイルの表示

@ -90,12 +90,12 @@ class ChildrenController extends Controller {
public function checkRegisterMain (Request $r) {
// トークンの確認
if (null === ($get = TelActivation::where('token', $r->token)->first())) {
if (null === ($get = TelActivation::select('id')->where('token', $r->token)->first())) {
return ['status_code' => 400, 'error_messages' => ['不正な登録トークン。']];
}
// 本登録に成功
return ['status_code' => 200];
return ['status_code' => 200, 'params' => $get];
}
public function registerMain (Request $r) {
@ -317,7 +317,7 @@ class ChildrenController extends Controller {
$child_select = ['id', 'image', 'last_name', 'first_name', 'tel'];
$meeting_approvals_select = ['approval_at'];
if (null === ($list = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$r->meeting_id)->whereNull('approval_at')->get())) {
if (null === ($list = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', (int)$r->meeting_id)->whereNull('approval_at')->orderBy('created_at', 'desc')->get())) {
return ['status_code' => 400];
}
@ -340,7 +340,7 @@ class ChildrenController extends Controller {
$child_select = ['id', 'image', 'last_name', 'first_name', 'tel'];
$meeting_approvals_select = ['approval_at'];
if (null === ($list = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', $r->meeting_id)->whereNotNull('approval_at')->get())) {
if (null === ($list = MeetingApprovals::select($meeting_approvals_select)->where('meeting_id', $r->meeting_id)->whereNotNull('approval_at')->orderBy('created_at', 'desc')->get())) {
return ['status_code' => 400];
}

ファイルの表示

@ -317,7 +317,7 @@ class FathersController extends Controller {
abort_if(null === session()->get('children') || null === ($rel = FatherRelation::where('father_id', (int)$father_id)->where('child_id', (int)session()->get('children')['id'])->first()), 404, $err);
}
if (null === ($result = Father::select($father_select)->where('id', (int)$father_id)->orderBy('created_at', 'desc')->first())) {
if (null === ($result = Father::select($father_select)->where('id', (int)$father_id)->first())) {
// 親詳細の取得に失敗
return ['status_code' => 400, 'error_messages' => ['親の更新に失敗しました。']];
}

ファイルの表示

@ -189,7 +189,7 @@ class MeetingsController extends Controller {
$meeting_approvals_select = ['child_id', 'approval_at'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->orderBy('created_at', 'desc')->get())) {
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' => 400];
}
@ -216,7 +216,7 @@ class MeetingsController extends Controller {
$meeting_approvals_select = ['child_id', 'approval_at'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->orderBy('created_at', 'desc')->get())) {
if (null === ($list = Meeting::select($meeting_select)->orderBy('updated_at', 'desc')->get())) {
return ['status_code' => 400];
}
@ -287,7 +287,7 @@ class MeetingsController extends Controller {
$meeting_approvals_select = ['approval_at'];
// 取得に成功
if (null === ($approval = MeetingApprovals::select('meeting_id')->where('child_id', (int)$r->child_id)->whereNull('approval_at')->orderBy('approval_at', 'asc')->get())) {
if (null === ($approval = MeetingApprovals::select('meeting_id')->where('child_id', (int)$r->child_id)->whereNull('approval_at')->orderBy('updated_at', 'asc')->get())) {
return ['status_code' => 400];
}
@ -325,7 +325,7 @@ class MeetingsController extends Controller {
$child_select = ['image'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->where('father_id', (int)$r->father_id)->orderBy('created_at', 'desc')->get())) {
if (null === ($list = Meeting::select($meeting_select)->where('father_id', (int)$r->father_id)->orderBy('updated_at', 'desc')->get())) {
return ['status_code' => 400];
}
@ -372,7 +372,7 @@ class MeetingsController extends Controller {
$child_select = ['image'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->where('father_id', (int)$r->father_id)->orderBy('created_at', 'desc')->get())) {
if (null === ($list = Meeting::select($meeting_select)->where('father_id', (int)$r->father_id)->orderBy('updated_at', 'desc')->get())) {
return ['status_code' => 400];
}
@ -413,7 +413,7 @@ class MeetingsController extends Controller {
$child_select = ['image'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->where('father_id', (int)$r->father_id)->where('is_favorite', 1)->orderBy('created_at', 'desc')->get())) {
if (null === ($list = Meeting::select($meeting_select)->where('father_id', (int)$r->father_id)->where('is_favorite', 1)->orderBy('updated_at', 'desc')->get())) {
return ['status_code' => 400];
}
@ -481,7 +481,7 @@ class MeetingsController extends Controller {
$meeting_approvals_select = ['approval_at'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->get())) {
if (null === ($list = Meeting::select($meeting_select)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->orderBy('created_at', 'desc')->get())) {
$list = [];
}
@ -515,7 +515,7 @@ class MeetingsController extends Controller {
$meeting_approvals_select = ['approval_at'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->get())) {
if (null === ($list = Meeting::select($meeting_select)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->orderBy('created_at', 'desc')->get())) {
$list = [];
}
@ -549,7 +549,7 @@ class MeetingsController extends Controller {
$child_select = ['image'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->where('father_id', (int)$r->father_id)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->orderBy('created_at', 'desc')->get())) {
if (null === ($list = Meeting::select($meeting_select)->where('father_id', (int)$r->father_id)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->orderBy('updated_at', 'desc')->get())) {
$list = [];
}
@ -596,7 +596,7 @@ class MeetingsController extends Controller {
$child_select = ['image'];
// 取得に成功
if (null === ($list = Meeting::select($meeting_select)->where('father_id', (int)$r->father_id)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->orderBy('created_at', 'desc')->get())) {
if (null === ($list = Meeting::select($meeting_select)->where('father_id', (int)$r->father_id)->where('title', 'LIKE', '%'.$r->keyword.'%')->orWhere('text', 'LIKE', '%'.$r->keyword.'%')->orderBy('updated_at', 'desc')->get())) {
$list = [];
}