fix amount check

This commit is contained in:
spen 2015-02-11 16:13:31 +08:00
parent dcb507659d
commit 5fd33b62f8
1 changed files with 4 additions and 4 deletions

View File

@ -56,19 +56,19 @@ class NkuhtDonatesController < ApplicationController
@nkuht_donate.donation_serial_number = NkuhtDonateMain.get_serial_number
@nkuht_donate.donation_payment_number = NkuhtDonateMain.get_payment_number
if @nkuht_donate.donation_amount < '1'
if @nkuht_donate.donation_amount.to_i < 1
@notice = []
@notice << t('nkuht_donate.donation_amount_err')
redirect_to "#{params[:referer_url]}", :notice => @notice
elsif @nkuht_donate.donation_way == '2' and @nkuht_donate.donation_amount > '30000'
elsif @nkuht_donate.donation_way == '2' and @nkuht_donate.donation_amount.to_i > 30000
@notice = []
@notice << t('nkuht_donate.donation_amount_atm')
redirect_to "#{params[:referer_url]}", :notice => @notice
elsif @nkuht_donate.donation_way == '3' and @nkuht_donate.donation_amount > '20000'
elsif @nkuht_donate.donation_way == '3' and @nkuht_donate.donation_amount.to_i > 20000
@notice = []
@notice << t('nkuht_donate.donation_amount_market')