diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 923225606..db2ea9249 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -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|