mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-07-17 05:36:13 +08:00
增减输出字段
This commit is contained in:
parent
43adee9ceb
commit
7b26961b86
@ -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,
|
||||
];
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user