diff --git a/webapp/controller/MallController.class.php b/webapp/controller/MallController.class.php index 559ce8f6..774e38a8 100644 --- a/webapp/controller/MallController.class.php +++ b/webapp/controller/MallController.class.php @@ -120,28 +120,20 @@ class MallController extends BaseAuthedController { return; } $itemId = getReqVal('item_id', ''); - $amount = getReqVal('amount', ''); + $amount = intval(getReqVal('amount', ''), 10); $currency = getReqVal('currency', ''); $priceBn = phpcommon\bnInit(getReqVal('price', '')); if ($itemId != V_ITEM_GOLD) { $this->_rspErr(1, 'only support gold'); return; } - if (!$this->checkPrice($priceBn)) { - return; - } - if (empty($amount)) { - $this->_rspErr(1, 'amount not found'); - return; - } - if (!is_numeric($amount)) { - $this->_rspErr(1, 'amount must be number'); - return; - } if ($amount <= 0) { $this->_rspErr(1, 'amount must > 0'); return; } + if (!$this->checkPrice($priceBn)) { + return; + } if (!in_array( $currency, array(