|
|
|
@ -93,6 +93,8 @@ module Mobile
|
|
|
|
|
#0回复 1回复的回复
|
|
|
|
|
reply_type = params[:reply_type]
|
|
|
|
|
|
|
|
|
|
update_id = 0
|
|
|
|
|
|
|
|
|
|
if params[:content]!="" && current_user
|
|
|
|
|
case type
|
|
|
|
|
when "HomeworkCommon"
|
|
|
|
@ -114,6 +116,7 @@ module Mobile
|
|
|
|
|
if (feedback.errors.empty?)
|
|
|
|
|
homework_common.update_column(:updated_at, Time.now)
|
|
|
|
|
result = 2
|
|
|
|
|
update_id = homework_common.id
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
#二级回复
|
|
|
|
@ -125,6 +128,7 @@ module Mobile
|
|
|
|
|
if (feedback.errors.empty?)
|
|
|
|
|
homework_common.update_column(:updated_at, Time.now)
|
|
|
|
|
result = 2
|
|
|
|
|
update_id = homework_common.id
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -148,6 +152,7 @@ module Mobile
|
|
|
|
|
comment.author = current_user
|
|
|
|
|
if news.comments << comment
|
|
|
|
|
result = 2
|
|
|
|
|
update_id = news.id
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
#二级回复
|
|
|
|
@ -156,6 +161,7 @@ module Mobile
|
|
|
|
|
new_comment = news.comments.build(:author_id => current_user.id, :reply_id => params[:id], :comments => params[:content], :parent_id => comment.id)
|
|
|
|
|
if new_comment.save
|
|
|
|
|
result = 2
|
|
|
|
|
update_id = news.id
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -185,6 +191,7 @@ module Mobile
|
|
|
|
|
reply.subject = "RE: #{topic.subject}"
|
|
|
|
|
if topic.children << reply
|
|
|
|
|
result = 2
|
|
|
|
|
update_id = topic.id
|
|
|
|
|
end
|
|
|
|
|
# else
|
|
|
|
|
#二级回复
|
|
|
|
@ -206,7 +213,7 @@ module Mobile
|
|
|
|
|
|
|
|
|
|
if status == 0
|
|
|
|
|
# if reply_type == nil || reply_type == 0
|
|
|
|
|
jour = JournalsForMessage.find params[:id]
|
|
|
|
|
jour = JournalsForMessage.find(params[:id]).root
|
|
|
|
|
parent_id = params[:id]
|
|
|
|
|
author_id = current_user.id
|
|
|
|
|
reply_user_id = jour.user_id
|
|
|
|
@ -223,6 +230,7 @@ module Mobile
|
|
|
|
|
if jfm.errors.empty?
|
|
|
|
|
(JournalsForMessage.find parent_id).update_attribute(:updated_on,Time.now)
|
|
|
|
|
result = 2
|
|
|
|
|
update_id = jour.id
|
|
|
|
|
end
|
|
|
|
|
# else
|
|
|
|
|
#二级回复
|
|
|
|
@ -244,10 +252,12 @@ module Mobile
|
|
|
|
|
is_jour.journalized = issue
|
|
|
|
|
if is_jour.save
|
|
|
|
|
result = 2
|
|
|
|
|
update_id = issue.id
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
#二级回复
|
|
|
|
|
issue = Issue.find params[:id]
|
|
|
|
|
jour = Journal.find(params[:id])
|
|
|
|
|
issue = jour.journalized
|
|
|
|
|
is_jour = Journal.new
|
|
|
|
|
is_jour.user_id = current_user.id
|
|
|
|
|
is_jour.notes = params[:content]
|
|
|
|
@ -256,6 +266,7 @@ module Mobile
|
|
|
|
|
is_jour.journalized = issue
|
|
|
|
|
if is_jour.save
|
|
|
|
|
result = 2
|
|
|
|
|
update_id = issue.id
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -269,6 +280,7 @@ module Mobile
|
|
|
|
|
blogComment.title = "RE: #{blog.title}"
|
|
|
|
|
if blog.children << blogComment
|
|
|
|
|
result = 2
|
|
|
|
|
update_id = blog.id
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
#二级回复
|
|
|
|
@ -284,16 +296,17 @@ module Mobile
|
|
|
|
|
|
|
|
|
|
if parent.children << blogComment
|
|
|
|
|
result = 2
|
|
|
|
|
update_id = blog.id
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if result == 2
|
|
|
|
|
update_course_activity_api(type,params[:id])
|
|
|
|
|
update_user_activity_api(type,params[:id])
|
|
|
|
|
update_org_activity_api(type,params[:id])
|
|
|
|
|
update_forge_activity_api(type,params[:id])
|
|
|
|
|
update_principal_activity_api(type,params[:id])
|
|
|
|
|
update_course_activity_api(type,update_id)
|
|
|
|
|
update_user_activity_api(type,update_id)
|
|
|
|
|
update_org_activity_api(type,update_id)
|
|
|
|
|
update_forge_activity_api(type,update_id)
|
|
|
|
|
update_principal_activity_api(type,update_id)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
result = 3
|
|
|
|
|