diff --git a/app/Caches/CoursePackageList.php b/app/Caches/CoursePackageList.php index 3462825d..f99a6e9a 100644 --- a/app/Caches/CoursePackageList.php +++ b/app/Caches/CoursePackageList.php @@ -45,6 +45,7 @@ class CoursePackageList extends Cache $result[] = [ 'id' => $package->id, 'title' => $package->title, + 'summary' => $package->summary, 'market_price' => $package->market_price, 'vip_price' => $package->vip_price, ]; diff --git a/app/Services/Category.php b/app/Services/Category.php index 403d9fad..9078863c 100644 --- a/app/Services/Category.php +++ b/app/Services/Category.php @@ -14,7 +14,7 @@ class Category extends Service * @param int $id * @return array */ - public function getNodePaths($id) + public function getCategoryPaths($id) { $categoryCache = new CategoryCache(); @@ -53,7 +53,7 @@ class Category extends Service * @param int $id * @return array */ - public function getChildNodeIds($id) + public function getChildCategoryIds($id) { $categoryCache = new CategoryCache(); diff --git a/app/Services/Frontend/Course/CourseInfo.php b/app/Services/Frontend/Course/CourseInfo.php index a8d6cda7..97294509 100644 --- a/app/Services/Frontend/Course/CourseInfo.php +++ b/app/Services/Frontend/Course/CourseInfo.php @@ -42,13 +42,13 @@ class CourseInfo extends Service 'study_expiry' => $course->study_expiry, 'refund_expiry' => $course->refund_expiry, 'rating' => (float)$course->rating, - 'score' => (float)$course->score, 'model' => $course->model, 'level' => $course->level, 'attrs' => $course->attrs, 'user_count' => $course->user_count, 'lesson_count' => $course->lesson_count, 'review_count' => $course->review_count, + 'comment_count' => $course->comment_count, 'favorite_count' => $course->favorite_count, ]; @@ -89,9 +89,9 @@ class CourseInfo extends Service protected function getCategoryPaths(CourseModel $course) { - $categoryService = new CategoryService(); + $service = new CategoryService(); - return $categoryService->getNodePaths($course->category_id); + return $service->getCategoryPaths($course->category_id); } protected function getTeachers(CourseModel $course) diff --git a/app/Services/Frontend/Course/CourseList.php b/app/Services/Frontend/Course/CourseList.php index 84b80259..11759fa0 100644 --- a/app/Services/Frontend/Course/CourseList.php +++ b/app/Services/Frontend/Course/CourseList.php @@ -20,7 +20,7 @@ class CourseList extends Service $categoryService = new CategoryService(); - $childNodeIds = $categoryService->getChildNodeIds($params['category_id']); + $childNodeIds = $categoryService->getChildCategoryIds($params['category_id']); $params['category_id'] = $childNodeIds; } @@ -63,7 +63,6 @@ class CourseList extends Service 'market_price' => (float)$course['market_price'], 'vip_price' => (float)$course['vip_price'], 'rating' => (float)$course['rating'], - 'score' => (float)$course['score'], 'model' => $course['model'], 'level' => $course['level'], 'user_count' => $course['user_count'],