1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-08-04 13:32:55 +08:00

优化分类等必选判断

This commit is contained in:
xiaochong0302 2024-01-22 12:37:58 +08:00
parent ebc609ac19
commit 56e04fc3a3
7 changed files with 8 additions and 14 deletions

View File

@ -200,7 +200,7 @@ class Article extends Service
$data['published'] = $validator->checkPublishStatus($post['published']); $data['published'] = $validator->checkPublishStatus($post['published']);
} }
if (isset($post['category_id'])) { if (isset($post['category_id']) && !empty($post['category_id'])) {
$category = $validator->checkCategory($post['category_id']); $category = $validator->checkCategory($post['category_id']);
$data['category_id'] = $category->id; $data['category_id'] = $category->id;
} }

View File

@ -165,12 +165,12 @@ class Course extends Service
$data['published'] = $validator->checkPublishStatus($post['published']); $data['published'] = $validator->checkPublishStatus($post['published']);
} }
if (isset($post['category_id'])) { if (isset($post['category_id']) && !empty($post['category_id'])) {
$category = $validator->checkCategory($post['category_id']); $category = $validator->checkCategory($post['category_id']);
$data['category_id'] = $category->id; $data['category_id'] = $category->id;
} }
if (isset($post['teacher_id'])) { if (isset($post['teacher_id']) && !empty($post['teacher_id'])) {
$teacher = $validator->checkTeacher($post['teacher_id']); $teacher = $validator->checkTeacher($post['teacher_id']);
$data['teacher_id'] = $teacher->id; $data['teacher_id'] = $teacher->id;
} }

View File

@ -186,7 +186,7 @@ class Question extends Service
$data['published'] = $validator->checkPublishStatus($post['published']); $data['published'] = $validator->checkPublishStatus($post['published']);
} }
if (isset($post['category_id'])) { if (isset($post['category_id']) && !empty($post['category_id'])) {
$category = $validator->checkCategory($post['category_id']); $category = $validator->checkCategory($post['category_id']);
$data['category_id'] = $category->id; $data['category_id'] = $category->id;
} }

View File

@ -102,7 +102,7 @@ class Controller extends \Phalcon\Mvc\Controller
$this->view->setVar('websocket_info', $this->websocketInfo); $this->view->setVar('websocket_info', $this->websocketInfo);
} }
protected function getAuthUser($cache = false) protected function getAuthUser($cache = true)
{ {
/** /**
* @var HomeAuth $auth * @var HomeAuth $auth

View File

@ -85,9 +85,7 @@ layui.use(['jquery', 'layer', 'helper'], function () {
}); });
$('.icon-reply').on('click', function () { $('.icon-reply').on('click', function () {
$('html').animate({ $('html').scrollTop($('#comment-anchor').offset().top);
scrollTop: $('#comment-anchor').offset().top
}, 500);
}); });
}); });

View File

@ -35,9 +35,7 @@ layui.use(['jquery', 'helper'], function () {
}); });
$('.icon-reply').on('click', function () { $('.icon-reply').on('click', function () {
$('html').animate({ $('html').scrollTop($('#comment-anchor').offset().top);
scrollTop: $('#comment-anchor').offset().top
}, 500);
}); });
}); });

View File

@ -85,9 +85,7 @@ layui.use(['jquery', 'helper'], function () {
}); });
$('.icon-reply').on('click', function () { $('.icon-reply').on('click', function () {
$('html').animate({ $('html').scrollTop($('#answer-anchor').offset().top);
scrollTop: $('#answer-anchor').offset().top
}, 500);
}); });
}); });