修改评论接口,匿评结束后依然可以评论(属于留言)

This commit is contained in:
z9hang 2015-02-03 15:46:17 +08:00
parent 9708c50899
commit 87e658a0f1
1 changed files with 2 additions and 7 deletions

View File

@ -146,13 +146,8 @@ class HomeworkService
@cur_page,@cur_type = params[:cur_page] || 1,params[:cur_type] || 5 @cur_page,@cur_type = params[:cur_page] || 1,params[:cur_type] || 5
@homework = HomeworkAttach.find(params[:homework_id]) @homework = HomeworkAttach.find(params[:homework_id])
comment_status = @homework.bid.comment_status comment_status = @homework.bid.comment_status
if @is_anonymous_comments && comment_status != 1 if @is_anonymous_comments && comment_status == 0
case comment_status raise '尚未开启匿评!'
when 0
raise '尚未开启匿评!'
when 2
raise '匿评已结束!'
end
end end
if @is_anonymous_comments && ((@m_score.nil? || @m_score.blank?) || !(params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "")) if @is_anonymous_comments && ((@m_score.nil? || @m_score.blank?) || !(params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""))
raise '您尚未打分或评论!' raise '您尚未打分或评论!'