@ -65,6 +65,10 @@ class Subject < ApplicationRecord
excellent ? CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).length : shixuns.pluck(:myshixuns_count).sum
end
def myshixuns_count
shixuns.pluck(:myshixuns_count).sum
def all_score
subject_shixun_score + subject_shixun_choose_score
@ -1,6 +1,6 @@
json.subjects @subjects do |subject|
json.(subject, :id, :excellent, :name, :stages_count, :shixuns_count)
json.myshixuns_count subject.excellent ? subject.member_count : subject.myshixuns_count
json.myshixuns_count subject.myshixuns_count
json.challenges_count subject.subject_challenge_count
json.image_url url_to_avatar(subject)
json.allow_visit subject.status > 1 || User.current.manager_of_subject?(subject) || User.current.admin?
@ -3,7 +3,7 @@ json.subject do
json.description @subject.description
json.shixuns_count @subject.shixuns_count
json.challenges_count @subject.subject_challenge_count
json.member_count @subject.member_count
json.member_count @subject.myshixuns_count
json.subject_score @subject.all_score
json.learning_notes @subject.learning_notes
@ -247,7 +247,7 @@ const App = (props) => {
<section className="static_section_header">
<div className="header_title">
<span className="title-p">学习统计</span>
<span className="title-sub">Android综合实训之物联网移动应用</span>
<span className="title-sub"></span>
</div>
<div className="header-number header-flex">
<StaticNumberAndTxt
@ -30,13 +30,13 @@
font-weight: bold;
&::before{
position: absolute;
content: '';
border-left: 1px solid rgba(192,196,204,1);
right: -10px;
top: 2px;
bottom: 0px;
margin-left: 10px;
//position: absolute;
//content: '';
//border-left: 1px solid rgba(192,196,204,1);
//right: -10px;
//top: 2px;
//bottom: 0px;
//margin-left: 10px;
}
.title-sub{
@ -105,7 +105,7 @@
.ant-table-thead{
th{
background: rgba(241,248,255,1);
.ant-table-column-title{
color: #303133;
@ -152,5 +152,5 @@
.tool-clazz{
max-width: 200px !important;