parser

Написать ответ на текущее сообщение

 

 
   команды управления поиском

to double or not to double

Zord 13.11.2015 10:38

Есть код:
^void:sql{
INSERT INTO `credit_product_list` (`c_id`,`product_id`,`credit_period`,`first_deposit`,`interest_rate`,`sum_credit`,`car_price`,`amount_discount`,`documents`,`monthly_payment`,`date_credit_delivery`,`date_credit_finish`,`date_beforehand_payment`,`policy_number`)
VALUES ($tClient.id, ^form:product_id.int(0), ^form:creditPeriod.int(0), ^form:firstDeposit.double(0),^form:interestRate.double(0), ^form:sumCredit.int(0),
^form:carPrice.double(0), ^form:disCount.int(0), ^form:documents.int(0), ^form:sumMonthPay.int(0),
^if(def $form:dataDelivery){'$form:dataDelivery'}{NULL},^if(def $form:dataFinish){'$form:dataFinish'}{NULL},^if(def $form:dataBeforehand){'$form:dataBeforehand'}{NULL},'^if(def $form:policyNum){$form:policyNum}')
}

Есть запрос с данными:
HTTP method: POST
Params:
hash(30): {
id: string: "46972",
add_product: string: "1",
product_id: string: "4",
creditPeriod: string: "36",
firstDeposit: string: "NaN",
interestRate: string: "16",
sumCredit: string: "760 000 ",
carPrice: string: "1518000",
disCount: string: "",
date_begin: string: "0",
date_end: string: "0",
reminder: string: "0",
prolongation: string: "0",
reminder_offset: string: "3",
typeProduct: string: "1",
documents: string: "1",
price: string: "",
sumMonthPay: string: "27900",
dataDelivery: string: "",
dataFinish: string: "",
dataBeforehand: string: "",
policyNum: string: "",
insurance_number: string: "",
insurance_contract_date: string: "",
payment_type: string: "0",
insurance_sum: string: "",
commission_persent_bonus: string: "",
commission_sum_bonus: string: "",
insurance_pay: string: "",
insurance_pay_number: string: ""
}

И есть ошибка:
Unhandled Exception (sql.execute)

INSERT INTO `credit_product_list` (`c_id`,`product_id`,`credit_period`,`first_deposit`,`interest_rate`,`sum_credit`,`car_price`,`amount_discount`,`documents`,`monthly_payment`,`date_credit_delivery`,`date_credit_finish`,`date_beforehand_payment`,`policy_number`)
VALUES (46972, 4, 36, nan,16, 0,
1518000, 0, 1, 27900,
NULL,NULL,NULL,'')


Unknown column 'nan' in 'field list'

Как?