fix status error

This commit is contained in:
thomaschen 2013-09-27 14:35:25 +08:00
parent d635c892cf
commit 50f5d12da3
1 changed files with 8 additions and 2 deletions

View File

@ -45,14 +45,20 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
new_status = "轉介其他單位"
elsif failed_count > 0 && success_count > 0
new_status = "部份轉介失敗"
else
elsif failed_count > 0 && success_count == 0
new_status = "轉介失敗"
elsif failed_count == 0 && success_count == 0 && @ask_reply.status == "待處理"
new_status = "待處理"
elsif failed_count == 0 && success_count == 0 && @ask_reply.status == "已處理"
new_status = "已處理"
elsif failed_count == 0 && success_count == 0 && @ask_reply.status == "轉介其他單位"
new_status = "轉介失敗"
end
@ask_reply.update_attributes(status: new_status)
redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success')
end
def send_request(dep_dns, current_question, current_reply)
require 'net/http'
require 'uri'