Update Saqel Platform: 2026-09-02 07:52:23

This commit is contained in:
Hamza-Ayed
2026-09-02 07:52:24 +03:00
parent 739f934a26
commit 36939a50c1
8 changed files with 38 additions and 22 deletions
+6 -3
View File
@@ -385,13 +385,16 @@ class VideoController
VideoService::ensureSchema();
CurriculumService::ensureSchema();
$rawId = $request->getParam('id') ?? '';
$curriculumKey = trim((string)($request->getQuery('curriculum_key') ?? ''));
$rawId = $curriculumKey !== '' ? $curriculumKey : ($request->getParam('id') ?? '');
$lesson = null;
if (is_numeric($rawId) && (int)$rawId > 0) {
if ($curriculumKey !== '') {
$lesson = Database::selectOne("SELECT * FROM lessons WHERE curriculum_key = ? LIMIT 1", [$curriculumKey]);
} elseif (is_numeric($rawId) && (int)$rawId > 0) {
$lesson = Database::selectOne("SELECT * FROM lessons WHERE id = ? LIMIT 1", [(int)$rawId]);
} elseif (!empty($rawId)) {
$lesson = Database::selectOne("SELECT * FROM lessons WHERE title LIKE ? OR local_path LIKE ? OR markdown_content LIKE ? LIMIT 1", ["%{$rawId}%", "%{$rawId}%", "%{$rawId}%"]);
$lesson = Database::selectOne("SELECT * FROM lessons WHERE curriculum_key = ? OR title LIKE ? OR local_path LIKE ? OR markdown_content LIKE ? LIMIT 1", [$rawId, "%{$rawId}%", "%{$rawId}%", "%{$rawId}%"]);
// Flutter curriculum lessons use the manifest slug (e.g. u1_l1_*),
// while the database stores the canonical lesson title.
if (!$lesson) {