◯ 4.子Bは登録完了、子Cは登録は可能だが親とリレーションしない

このコミットが含まれているのは:
守矢諏訪子 2022-01-28 22:03:45 +09:00
コミット 92689b6911
1個のファイルの変更3行の追加1行の削除

ファイルの表示

@ -119,7 +119,9 @@ class ChildrenController extends Controller {
// 親子関係の上限の場合
if (!is_null($get->father_id) && null !== ($rel = FatherRelation::where('father_id', $get->father_id)->first())) {
if (Father::select('relation_limit')->where('id', $get->father_id)->first()->relation_limit >= FatherRelation::where('father_id', $get->father_id)->count()) {
$fa = Father::select('relation_limit')->where('id', $get->father_id)->first();
$fr = FatherRelation::where('father_id', $get->father_id)->count();
if (null !== $fa && $fr >= $fa->relation_limit) {
return ['status_code' => 400, 'error_messages' => ['仮登録の有効期限が切れました。改めて親にお問い合わせいただき、再登録の手続きを行ってください。']];
}
}