From 7b26961b86ca0c6a6a72c89362fed09300419962 Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Sat, 25 Apr 2020 19:15:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=87=8F=E8=BE=93=E5=87=BA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Caches/CoursePackageList.php | 1 + app/Services/Category.php | 4 ++-- app/Services/Frontend/Course/CourseInfo.php | 6 +++--- app/Services/Frontend/Course/CourseList.php | 3 +-- 4 files changed, 7 insertions(+), 7 deletions(-) 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'],