1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-08-15 10:51:40 +08:00

!38 修复课程分类未过滤

* 过滤课程分类
This commit is contained in:
koogua 2020-12-09 15:25:55 +08:00
parent 6b56711fe9
commit e35c55a03f

View File

@ -8,6 +8,7 @@ use App\Caches\CourseCategoryList as CourseCategoryListCache;
use App\Caches\CourseRelatedList as CourseRelatedListCache;
use App\Caches\CourseTeacherList as CourseTeacherListCache;
use App\Library\Paginator\Query as PagerQuery;
use App\Models\Category as CategoryModel;
use App\Models\Course as CourseModel;
use App\Models\CourseCategory as CourseCategoryModel;
use App\Models\CourseRating as CourseRatingModel;
@ -224,7 +225,10 @@ class Course extends Service
{
$categoryRepo = new CategoryRepo();
$allCategories = $categoryRepo->findAll(['deleted' => 0]);
$allCategories = $categoryRepo->findAll([
'type' => CategoryModel::TYPE_COURSE,
'deleted' => 0,
]);
if ($allCategories->count() == 0) {
return [];