匿评作品详情返回结果中添加comment_status字段 0:所属作业尚未开启匿评,1:匿评中 2:匿评结束

This commit is contained in:
z9hang 2015-02-03 16:03:30 +08:00
parent 87e658a0f1
commit 8216453a02
1 changed files with 4 additions and 0 deletions

View File

@ -17,6 +17,8 @@ module Mobile
case field
when :homework_times
f.bid.courses.first.homeworks.index(f.bid) + 1 unless (f.bid.nil? || f.bid.courses.nil? || f.bid.courses.first.nil?)
when :comment_status
f.bid.comment_status
end
end
end
@ -28,6 +30,8 @@ module Mobile
homework_attach_expose :homework_times
homework_attach_expose :description
homework_attach_expose :created_at
#comment_status 0:所属作业尚未开启匿评1匿评中 2匿评结束
homework_attach_expose :comment_status
expose :attachments,using: Mobile::Entities::Attachment do |f, opt|
if f.respond_to?(:attachments)
f.send(:attachments)