diff --git a/webapp/controller/HashRateShopController.class.php b/webapp/controller/HashRateShopController.class.php index 5fdb4d98..80d1fd06 100644 --- a/webapp/controller/HashRateShopController.class.php +++ b/webapp/controller/HashRateShopController.class.php @@ -1,8 +1,12 @@ _rspErr(1, 'no right to purchase'); return; } - $itemMeta = mt\Item::get($goodsMeta['item_id']); + $itemMeta = mt\Item::get($goodsMeta['type']); if (!$itemMeta) { myself()->_rspErr(1, 'goods not found, goods_id: ' . $goodsMeta['goods_id']); return; @@ -73,11 +77,11 @@ class HashRateShopController extends BaseAuthedController { myself()->_rspErr(1, "config error"); return; } - if ($price * $goodsNum < model\HashRate::getMyCurrentHashRate()) { + if ($price * $goodsNum < models\HashRate::getMyCurrentHashRate()) { myself()->_rspErr(2, "hashrate not enough"); return; } - model\HashRate::decMyCurrentHashRate($price * $goodsNum); + models\HashRate::decMyCurrentHashRate($price * $goodsNum); HashRateShopBuyRecord::add($goodsMeta['goods_id'], $goodsNum, $goodsMeta['type']); for ($i = 0; $i < $goodsNum; $i++) { $this->internalAddItem($awardService,