1
This commit is contained in:
parent
06876cc65f
commit
a9f9c6f824
@ -14,7 +14,6 @@ require_once('models/Transaction.php');
|
||||
require_once('models/BuyRecord.php');
|
||||
require_once('models/Chip.php');
|
||||
require_once('models/BcOrder.php');
|
||||
require_once('models/Mall.php');
|
||||
require_once('models/Recharge.php');
|
||||
|
||||
require_once('services/AwardService.php');
|
||||
@ -29,7 +28,6 @@ use models\Transaction;
|
||||
use models\BuyRecord;
|
||||
use models\Chip;
|
||||
use models\BcOrder;
|
||||
use models\Mall;
|
||||
use models\Recharge;
|
||||
|
||||
use services\BlockChainService;
|
||||
@ -408,55 +406,6 @@ class BlockChainController extends BaseAuthedController {
|
||||
);
|
||||
}
|
||||
|
||||
public function _buyMallProduct()
|
||||
{
|
||||
return;
|
||||
$address = myself()->_getAddress();
|
||||
if (empty($address)) {
|
||||
myself()-_rspErr(1, 'address not found');
|
||||
return;
|
||||
}
|
||||
|
||||
$goodsUuid = getReqVal('goods_uuid', '');
|
||||
$price = getReqVal('price', '');
|
||||
if (empty($price)) {
|
||||
myself()-_rspErr(1, 'price not found');
|
||||
return;
|
||||
}
|
||||
if (!is_numeric($price)) {
|
||||
myself()-_rspErr(1, 'price not number');
|
||||
return;
|
||||
}
|
||||
|
||||
$goodsDb = Mall::findByGoodsUuid($goodsUuid);
|
||||
if (!$goodsDb) {
|
||||
myself()-_rspErr(1, 'goods not found, idx:');
|
||||
return;
|
||||
}
|
||||
if ($goodsDb['status'] != Mall::PENDING_STATE) {
|
||||
myself()-_rspErr(1, 'cant buy');
|
||||
return;
|
||||
}
|
||||
|
||||
$rspObj = BlockChainService::gameItemMarketBuy(
|
||||
Transaction::BUY_GOODS_FROM_MARKET_ACTION_TYPE,
|
||||
$goodsDb['seller_address'],
|
||||
$goodsDb['currency'],
|
||||
$goodsDb['price'],
|
||||
$goodsDb['item_id'],
|
||||
$goodsDb['item_num'],
|
||||
$goodsDb['order_id']
|
||||
);
|
||||
|
||||
Mall::buy($goodsUuid, $address);
|
||||
|
||||
$this->_rspData(array(
|
||||
'trans_id' => $rspObj['trans_id'],
|
||||
'order_id' => $goodsDb['order_id'],
|
||||
'params' => $rspObj['params'],
|
||||
));
|
||||
}
|
||||
|
||||
private function rechargeBuyS()
|
||||
{
|
||||
$goodsMeta = mt\Recharge::get(getReqVal('goods_id', ''));
|
||||
|
Loading…
x
Reference in New Issue
Block a user