From 10f810960ea8cfed5024764e7830c0aedcad78df Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Wed, 9 Nov 2016 14:15:37 +0800 Subject: [PATCH] . --- app/api/mobile/entities/issue.rb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/api/mobile/entities/issue.rb b/app/api/mobile/entities/issue.rb index 3fa3f311d..8d5ff37f1 100644 --- a/app/api/mobile/entities/issue.rb +++ b/app/api/mobile/entities/issue.rb @@ -24,8 +24,8 @@ module Mobile IssueStatus.find(issue.status_id).name when :comment_count issue.journals.where("notes is not null and notes != ''").count - # all_comments = [] - # get_all_children(all_comments, f).count + # all_comments = [] + # get_all_children(all_comments, f).count when :project_name issue.project.name when :praise_count @@ -99,7 +99,8 @@ module Mobile if f.is_a?(::Issue) # f.journals_for_messages.reverse if !opt[:children] && opt[:type] == 0 - opt[:children] = true + #opt[:children] = true + opt.merge({:children=>true}) tStart = opt[:page]*5 tEnd = (opt[:page]+1)*5 - 1 @@ -135,7 +136,8 @@ module Mobile # opt[:bottom] = true # parents_reply[opt[:page]..opt[:page]] else - opt[:bottom] = true + #opt[:bottom] = true + opt.merge({:bottom=>true}) parents_reply[0..0] end else @@ -151,7 +153,8 @@ module Mobile parents_reply = get_reply_parents(parents_reply, f) if parents_reply.count > 2 && !opt[:top] if opt[:type] == 1 - opt[:top] = true + #opt[:top] = true + opt.merge({:top=>true}) tStart = (opt[:page]-1)*5+2 tEnd = (opt[:page])*5+2 - 1 @@ -166,12 +169,14 @@ module Mobile [] end else - opt[:top] = true + #opt[:top] = true + opt.merge({:top=>true}) parents_reply = parents_reply.reverse[0..1] parents_reply.reverse end elsif parents_reply.count == 2 && !opt[:top] - opt[:top] = true + #opt[:top] = true + opt.merge({:top=>true}) parents_reply = parents_reply.reverse[0..0] parents_reply.reverse else