缺评列表显示
This commit is contained in:
parent
73d7ae4988
commit
981ad6e743
|
@ -257,7 +257,7 @@ class StudentWorkController < ApplicationController
|
|||
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
|
||||
@stundet_works = StudentWork.find_by_sql("SELECT *,(all_count - has_count) AS absence FROM(
|
||||
SELECT * ,
|
||||
(SELECT evaluation_num FROM homework_detail_manuals WHERE homework_detail_manuals.homework_common_id = #{@homework.id}) AS all_count,
|
||||
(SELECT COUNT(*) FROM `student_works_evaluation_distributions` WHERE user_id = student_works.user_id AND student_work_id IN #{work_ids}) AS all_count,
|
||||
(SELECT COUNT(*) FROM `student_works_scores` WHERE user_id = student_works.user_id AND student_work_id IN #{work_ids}) AS has_count
|
||||
FROM `student_works`
|
||||
WHERE homework_common_id = #{@homework.id}
|
||||
|
|
Loading…
Reference in New Issue