mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-25 04:07:17 +08:00
格式化课程评分
This commit is contained in:
parent
acc25bb5dc
commit
cebd2f09e6
@ -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),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -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'],
|
||||
|
@ -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'],
|
||||
|
@ -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');
|
||||
});
|
||||
|
@ -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 () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user