From d03999ebf35e03472174e234f0f06565458bd475 Mon Sep 17 00:00:00 2001 From: koogua Date: Mon, 18 Oct 2021 18:56:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=A6=96=E9=A1=B5=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E8=99=9A=E6=8B=9F=E7=94=A8=E6=88=B7=E6=95=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Caches/IndexFeaturedCourseList.php | 9 ++++++++- app/Caches/IndexFreeCourseList.php | 9 ++++++++- app/Caches/IndexNewCourseList.php | 9 ++++++++- app/Caches/IndexSimpleFeaturedCourseList.php | 9 ++++++++- app/Caches/IndexSimpleFreeCourseList.php | 9 ++++++++- app/Caches/IndexSimpleNewCourseList.php | 9 ++++++++- app/Caches/IndexSimpleVipCourseList.php | 9 ++++++++- app/Caches/IndexVipCourseList.php | 9 ++++++++- 8 files changed, 64 insertions(+), 8 deletions(-) diff --git a/app/Caches/IndexFeaturedCourseList.php b/app/Caches/IndexFeaturedCourseList.php index 9ef38676..db32e861 100644 --- a/app/Caches/IndexFeaturedCourseList.php +++ b/app/Caches/IndexFeaturedCourseList.php @@ -65,6 +65,13 @@ class IndexFeaturedCourseList extends Cache $categoryCourses = []; foreach ($courses as $course) { + + $userCount = $course->user_count; + + if ($course->fake_user_count > $course->user_count) { + $userCount = $course->fake_user_count; + } + $categoryCourses[] = [ 'id' => $course->id, 'title' => $course->title, @@ -73,7 +80,7 @@ class IndexFeaturedCourseList extends Cache 'vip_price' => $course->vip_price, 'model' => $course->model, 'level' => $course->level, - 'user_count' => $course->user_count, + 'user_count' => $userCount, 'lesson_count' => $course->lesson_count, ]; } diff --git a/app/Caches/IndexFreeCourseList.php b/app/Caches/IndexFreeCourseList.php index ecd23215..23e1c41e 100644 --- a/app/Caches/IndexFreeCourseList.php +++ b/app/Caches/IndexFreeCourseList.php @@ -65,6 +65,13 @@ class IndexFreeCourseList extends Cache $categoryCourses = []; foreach ($courses as $course) { + + $userCount = $course->user_count; + + if ($course->fake_user_count > $course->user_count) { + $userCount = $course->fake_user_count; + } + $categoryCourses[] = [ 'id' => $course->id, 'title' => $course->title, @@ -73,7 +80,7 @@ class IndexFreeCourseList extends Cache 'vip_price' => $course->vip_price, 'model' => $course->model, 'level' => $course->level, - 'user_count' => $course->user_count, + 'user_count' => $userCount, 'lesson_count' => $course->lesson_count, ]; } diff --git a/app/Caches/IndexNewCourseList.php b/app/Caches/IndexNewCourseList.php index 1049d2c2..33bb9b32 100644 --- a/app/Caches/IndexNewCourseList.php +++ b/app/Caches/IndexNewCourseList.php @@ -65,6 +65,13 @@ class IndexNewCourseList extends Cache $categoryCourses = []; foreach ($courses as $course) { + + $userCount = $course->user_count; + + if ($course->fake_user_count > $course->user_count) { + $userCount = $course->fake_user_count; + } + $categoryCourses[] = [ 'id' => $course->id, 'title' => $course->title, @@ -73,7 +80,7 @@ class IndexNewCourseList extends Cache 'vip_price' => $course->vip_price, 'model' => $course->model, 'level' => $course->level, - 'user_count' => $course->user_count, + 'user_count' => $userCount, 'lesson_count' => $course->lesson_count, ]; } diff --git a/app/Caches/IndexSimpleFeaturedCourseList.php b/app/Caches/IndexSimpleFeaturedCourseList.php index f3588fed..32801d99 100644 --- a/app/Caches/IndexSimpleFeaturedCourseList.php +++ b/app/Caches/IndexSimpleFeaturedCourseList.php @@ -42,6 +42,13 @@ class IndexSimpleFeaturedCourseList extends Cache $result = []; foreach ($courses as $course) { + + $userCount = $course->user_count; + + if ($course->fake_user_count > $course->user_count) { + $userCount = $course->fake_user_count; + } + $result[] = [ 'id' => $course->id, 'title' => $course->title, @@ -50,7 +57,7 @@ class IndexSimpleFeaturedCourseList extends Cache 'vip_price' => $course->vip_price, 'model' => $course->model, 'level' => $course->level, - 'user_count' => $course->user_count, + 'user_count' => $userCount, 'lesson_count' => $course->lesson_count, ]; } diff --git a/app/Caches/IndexSimpleFreeCourseList.php b/app/Caches/IndexSimpleFreeCourseList.php index a37e8779..9a71dbb7 100644 --- a/app/Caches/IndexSimpleFreeCourseList.php +++ b/app/Caches/IndexSimpleFreeCourseList.php @@ -42,6 +42,13 @@ class IndexSimpleFreeCourseList extends Cache $result = []; foreach ($courses as $course) { + + $userCount = $course->user_count; + + if ($course->fake_user_count > $course->user_count) { + $userCount = $course->fake_user_count; + } + $result[] = [ 'id' => $course->id, 'title' => $course->title, @@ -50,7 +57,7 @@ class IndexSimpleFreeCourseList extends Cache 'vip_price' => $course->vip_price, 'model' => $course->model, 'level' => $course->level, - 'user_count' => $course->user_count, + 'user_count' => $userCount, 'lesson_count' => $course->lesson_count, ]; } diff --git a/app/Caches/IndexSimpleNewCourseList.php b/app/Caches/IndexSimpleNewCourseList.php index b43166a9..a498fac7 100644 --- a/app/Caches/IndexSimpleNewCourseList.php +++ b/app/Caches/IndexSimpleNewCourseList.php @@ -42,6 +42,13 @@ class IndexSimpleNewCourseList extends Cache $result = []; foreach ($courses as $course) { + + $userCount = $course->user_count; + + if ($course->fake_user_count > $course->user_count) { + $userCount = $course->fake_user_count; + } + $result[] = [ 'id' => $course->id, 'title' => $course->title, @@ -50,7 +57,7 @@ class IndexSimpleNewCourseList extends Cache 'vip_price' => $course->vip_price, 'model' => $course->model, 'level' => $course->level, - 'user_count' => $course->user_count, + 'user_count' => $userCount, 'lesson_count' => $course->lesson_count, ]; } diff --git a/app/Caches/IndexSimpleVipCourseList.php b/app/Caches/IndexSimpleVipCourseList.php index d4474287..7162d431 100644 --- a/app/Caches/IndexSimpleVipCourseList.php +++ b/app/Caches/IndexSimpleVipCourseList.php @@ -42,6 +42,13 @@ class IndexSimpleVipCourseList extends Cache $result = []; foreach ($courses as $course) { + + $userCount = $course->user_count; + + if ($course->fake_user_count > $course->user_count) { + $userCount = $course->fake_user_count; + } + $result[] = [ 'id' => $course->id, 'title' => $course->title, @@ -50,7 +57,7 @@ class IndexSimpleVipCourseList extends Cache 'vip_price' => $course->vip_price, 'model' => $course->model, 'level' => $course->level, - 'user_count' => $course->user_count, + 'user_count' => $userCount, 'lesson_count' => $course->lesson_count, ]; } diff --git a/app/Caches/IndexVipCourseList.php b/app/Caches/IndexVipCourseList.php index 163bff1f..4d8d78a6 100644 --- a/app/Caches/IndexVipCourseList.php +++ b/app/Caches/IndexVipCourseList.php @@ -65,6 +65,13 @@ class IndexVipCourseList extends Cache $categoryCourses = []; foreach ($courses as $course) { + + $userCount = $course->user_count; + + if ($course->fake_user_count > $course->user_count) { + $userCount = $course->fake_user_count; + } + $categoryCourses[] = [ 'id' => $course->id, 'title' => $course->title, @@ -73,7 +80,7 @@ class IndexVipCourseList extends Cache 'vip_price' => $course->vip_price, 'model' => $course->model, 'level' => $course->level, - 'user_count' => $course->user_count, + 'user_count' => $userCount, 'lesson_count' => $course->lesson_count, ]; }