diff --git a/app/controllers/trainings_controller.rb b/app/controllers/trainings_controller.rb index 0f291f4e..029b4a31 100644 --- a/app/controllers/trainings_controller.rb +++ b/app/controllers/trainings_controller.rb @@ -173,6 +173,9 @@ class TrainingsController < ApplicationController if training_info.pay_type.to_i == TrainingPayinfo::PayType_Wechat training_info.status = TrainingPayinfo::Status_None + elsif params[:offline_later_pay].to_s == 'true' + # 线下支付-稍后支付 + training_info.status = TrainingPayinfo::Status_None else training_info.status = TrainingPayinfo::Status_Wait end @@ -197,6 +200,7 @@ class TrainingsController < ApplicationController attachment = Attachment.create!(file: params[:image], author: User.first) training_payinfo = @training.training_payinfo training_payinfo.attachment = attachment + training_payinfo.status = TrainingPayinfo::Status_Wait if training_payinfo.status == TrainingPayinfo::Status_None training_payinfo.save! render json: {status: 0} end diff --git a/app/views/trainings/pay.html.erb b/app/views/trainings/pay.html.erb index 8474233f..4ef654fb 100644 --- a/app/views/trainings/pay.html.erb +++ b/app/views/trainings/pay.html.erb @@ -1,6 +1,8 @@