module Mobile module Entities class Issue 0 && !opt[:bottom] if opt[:type] == 1 # opt[:bottom] = true # parents_reply[opt[:page]..opt[:page]] else opt[:bottom] = true parents_reply[0..0] end else [] end end end expose :parents_reply_top, using:Mobile::Entities::Issue do |f,opt| if f.is_a? (::Journal) #取二级回复的顶楼层 parents_reply = [] parents_reply = get_reply_parents(parents_reply, f) if parents_reply.count > 2 && !opt[:top] if opt[:type] == 1 opt[:top] = true tStart = (opt[:page]-1)*5+2 tEnd = (opt[:page])*5+2 - 1 if tEnd >= parents_reply.count - 1 tEnd = parents_reply.count - 2 end if tStart <= parents_reply.count - 2 parents_reply = parents_reply.reverse[tStart..tEnd] parents_reply.reverse else [] end else opt[:top] = true parents_reply = parents_reply.reverse[0..1] parents_reply.reverse end elsif parents_reply.count == 2 && !opt[:top] opt[:top] = true parents_reply = parents_reply.reverse[0..0] parents_reply.reverse else [] end end end end end end