|
|
|
@ -412,7 +412,7 @@ class BidsController < ApplicationController
|
|
|
|
|
#增加作业按评分排序,
|
|
|
|
|
@homework_list = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
|
|
|
|
|
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id) AS score
|
|
|
|
|
FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY score DESC",:include => [:attachments])
|
|
|
|
|
FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY score DESC,created_at ASC",:include => [:attachments])
|
|
|
|
|
if params[:student_id].present?
|
|
|
|
|
@temp = []
|
|
|
|
|
@homework_list.each do |pro|
|
|
|
|
|