This commit is contained in:
aozhiwei 2023-08-08 16:50:56 +08:00
parent ebf0efc987
commit 48ffcea204

View File

@ -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(