From aa0e7735922b75a7b696c84ccbdd74fc9e8f816a Mon Sep 17 00:00:00 2001 From: RomanGolienko Date: Thu, 6 Jun 2024 09:37:54 +0300 Subject: [PATCH] EGE bug fix --- app/Services/DirectonHtmlBuilder.php | 12 +++++++++--- app/Services/DirectonHtmlBuilderForCalculator.php | 11 +++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/Services/DirectonHtmlBuilder.php b/app/Services/DirectonHtmlBuilder.php index 5f720f3..b7ed42f 100644 --- a/app/Services/DirectonHtmlBuilder.php +++ b/app/Services/DirectonHtmlBuilder.php @@ -55,10 +55,16 @@ class DirectonHtmlBuilder
'; - foreach ($direction['entrance_examinations']['ЕГЭ']['Обязательные'] as $key => $el) { - $EGE .= '' . $key . ' - ' . '' . $el . '
' ; + if (array_key_exists('ЕГЭ', $direction['entrance_examinations'])){ + foreach ($direction['entrance_examinations']['ЕГЭ']['Обязательные'] as $key => $el) { + $EGE .= '' . $key . ' - ' . '' . $el . '
' ; + } + $EGE .= '
'; + } else { + $EGE = ''; } - $EGE .= ''; + + $po_viboru = '
Предметы по выбору diff --git a/app/Services/DirectonHtmlBuilderForCalculator.php b/app/Services/DirectonHtmlBuilderForCalculator.php index ddbba18..ec61a9f 100644 --- a/app/Services/DirectonHtmlBuilderForCalculator.php +++ b/app/Services/DirectonHtmlBuilderForCalculator.php @@ -55,11 +55,14 @@ class DirectonHtmlBuilderForCalculator

'; - foreach ($direction['entrance_examinations']['ЕГЭ']['Обязательные'] as $key => $el) { - $EGE .= '' . $key . ' - ' . '' . $el . '
' ; + if (array_key_exists('ЕГЭ', $direction['entrance_examinations'])) { + foreach ($direction['entrance_examinations']['ЕГЭ']['Обязательные'] as $key => $el) { + $EGE .= '' . $key . ' - ' . '' . $el . '
'; + } + $EGE .= '
'; + } else { + $EGE = ''; } - $EGE .= ''; - $po_viboru = '
Предметы по выбору
-- 2.41.0