From cebd2f09e6dcc2b296a48ab8237d6440d489f159 Mon Sep 17 00:00:00 2001 From: koogua Date: Thu, 30 Sep 2021 11:07:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E8=AF=84=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/Logic/Course/BasicInfo.php | 8 ++++---- app/Services/Logic/Course/CourseList.php | 2 +- app/Services/Logic/Search/Course.php | 1 + public/static/home/js/article.show.js | 11 ----------- public/static/home/js/question.show.js | 10 ++-------- 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/app/Services/Logic/Course/BasicInfo.php b/app/Services/Logic/Course/BasicInfo.php index 9f527719..658b1aad 100644 --- a/app/Services/Logic/Course/BasicInfo.php +++ b/app/Services/Logic/Course/BasicInfo.php @@ -70,10 +70,10 @@ class BasicInfo extends LogicService $rating = $repo->findCourseRating($course->id); return [ - 'rating' => $rating->rating, - 'rating1' => $rating->rating1, - 'rating2' => $rating->rating2, - 'rating3' => $rating->rating3, + 'rating' => round($rating->rating, 1), + 'rating1' => round($rating->rating1, 1), + 'rating2' => round($rating->rating2, 1), + 'rating3' => round($rating->rating3, 1), ]; } diff --git a/app/Services/Logic/Course/CourseList.php b/app/Services/Logic/Course/CourseList.php index e7f0cf5f..4d29d144 100644 --- a/app/Services/Logic/Course/CourseList.php +++ b/app/Services/Logic/Course/CourseList.php @@ -80,7 +80,7 @@ class CourseList extends LogicService 'cover' => $course['cover'], 'market_price' => (float)$course['market_price'], 'vip_price' => (float)$course['vip_price'], - 'rating' => (float)$course['rating'], + 'rating' => round($course['rating'], 1), 'model' => $course['model'], 'level' => $course['level'], 'user_count' => $course['user_count'], diff --git a/app/Services/Logic/Search/Course.php b/app/Services/Logic/Search/Course.php index 92fa1338..0926573f 100644 --- a/app/Services/Logic/Search/Course.php +++ b/app/Services/Logic/Search/Course.php @@ -90,6 +90,7 @@ class Course extends Handler 'summary' => (string)$item['summary'], 'model' => (int)$item['model'], 'level' => (int)$item['level'], + 'rating' => round($item['rating'], 1), 'market_price' => (float)$item['market_price'], 'vip_price' => (float)$item['vip_price'], 'user_count' => (int)$item['user_count'], diff --git a/public/static/home/js/article.show.js b/public/static/home/js/article.show.js index bf5acfbd..5e52fa33 100644 --- a/public/static/home/js/article.show.js +++ b/public/static/home/js/article.show.js @@ -15,17 +15,6 @@ layui.use(['jquery', 'layer', 'helper'], function () { helper.ajaxLoadHtml($commentList.data('url'), $commentList.attr('id')); } - $('.article-report').on('click', function () { - var url = $(this).data('url'); - layer.open({ - type: 2, - title: '内容举报', - shadeClose: true, - content: [url, 'no'], - area: ['640px', '480px'], - }); - }); - $('.article-edit').on('click', function () { window.location.href = $(this).data('url'); }); diff --git a/public/static/home/js/question.show.js b/public/static/home/js/question.show.js index 7b3e9412..4bc30dc1 100644 --- a/public/static/home/js/question.show.js +++ b/public/static/home/js/question.show.js @@ -24,17 +24,11 @@ layui.use(['jquery', 'helper'], function () { }); $('.question-edit').on('click', function () { - var url = $(this).data('url'); - helper.checkLogin(function () { - window.location.href = url; - }); + window.location.href = $(this).data('url'); }); $('.btn-answer').on('click', function () { - var url = $(this).data('url'); - helper.checkLogin(function () { - window.location.href = url; - }); + window.location.href = $(this).data('url'); }); $('.icon-star').on('click', function () {