Fix bugs
This commit is contained in:
parent
660960f316
commit
3eeda5410c
|
@ -13,6 +13,7 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
|
||||||
def create
|
def create
|
||||||
@ask_question = AskQuestion.find(params[:ask_question_id])
|
@ask_question = AskQuestion.find(params[:ask_question_id])
|
||||||
@ask_question.ask_reply = AskReply.new(params[:ask_reply])
|
@ask_question.ask_reply = AskReply.new(params[:ask_reply])
|
||||||
|
@ask_reply = @ask_question.ask_reply
|
||||||
@ask_question.save
|
@ask_question.save
|
||||||
if @ask_question.ask_reply.send_email?
|
if @ask_question.ask_reply.send_email?
|
||||||
Resque.enqueue(SendAskReplyMail, @ask_reply.ask_question.id)
|
Resque.enqueue(SendAskReplyMail, @ask_reply.ask_question.id)
|
||||||
|
@ -44,7 +45,7 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
|
||||||
elsif failed_count == 0 && success_count == 0 && @ask_reply.status == "轉介其他單位"
|
elsif failed_count == 0 && success_count == 0 && @ask_reply.status == "轉介其他單位"
|
||||||
new_status = "轉介失敗"
|
new_status = "轉介失敗"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ask_reply.update_attributes(status: new_status)
|
@ask_reply.update_attributes(status: new_status)
|
||||||
|
|
||||||
redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success')
|
redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success')
|
||||||
|
|
Loading…
Reference in New Issue