2026-10-04 single-teacher.php

This commit is contained in:
Dekart Deploy Bot 2026-10-04 20:19:20 +00:00
parent 453035ea4b
commit dcac71ac4c

View File

@ -301,10 +301,6 @@ foreach ($teacher_subjects as $ts) {
if ('' === $sn) {
continue;
}
$sn_key = mb_strtolower($sn);
if (isset($subject_items[$sn_key])) {
continue; // дубликат заголовка — пропускаем
}
$topics = array();
$topics_raw = trim((string) ( $ts['teacher_subjects_topics'] ?? '' ));
if ('' !== $topics_raw) {
@ -316,14 +312,14 @@ foreach ($teacher_subjects as $ts) {
}
}
$prog = $branch_programs_by_name[ $sn ] ?? null;
$subject_items[$sn_key] = array(
$subject_items[] = array(
'name' => $sn,
'url' => ( $prog && '' !== $prog['url'] ) ? $prog['url'] : trim((string) ( $ts['teacher_subjects_url'] ?? '')),
'price' => ( $prog && '' !== $prog['price'] ) ? $prog['price'] : '',
'topics' => $topics,
);
}
$subject_names = array_map(function ($it) { return $it['name']; }, array_values($subject_items));
$subject_names = array_values(array_unique(array_map(function ($it) { return $it['name']; }, $subject_items)));
// ─── Данные филиала ───
$branch_price = get_option('branch_price');