diff --git a/app/api/mobile/entities/homework_attach.rb b/app/api/mobile/entities/homework_attach.rb index 256dcdf61..690ec8e94 100644 --- a/app/api/mobile/entities/homework_attach.rb +++ b/app/api/mobile/entities/homework_attach.rb @@ -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)