|
|
|
@ -18,7 +18,7 @@ class TrainingsController < ApplicationController
|
|
|
|
|
def show
|
|
|
|
|
@training = current_training
|
|
|
|
|
|
|
|
|
|
if @training.training_payinfo.present? && params[:disable_redirect].blank?
|
|
|
|
|
if @training.training_payinfo.present? && !@training.training_payinfo.not_payed? && params[:disable_redirect].blank?
|
|
|
|
|
redirect_to result_training_path(id: friendly_id)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
@ -125,7 +125,7 @@ class TrainingsController < ApplicationController
|
|
|
|
|
attachment = nil
|
|
|
|
|
attachment = Attachment.create!(file: params[:image], author: User.first) if params[:image]
|
|
|
|
|
|
|
|
|
|
if attachment.blank? && training_info.not_payed?
|
|
|
|
|
if training_info.attachment.blank? && attachment.blank? && training_info.not_payed?
|
|
|
|
|
flash[:message] = '请先上传支付凭证'
|
|
|
|
|
render 'pay'
|
|
|
|
|
return
|
|
|
|
|