This commit is contained in:
aozhiwei 2022-01-26 13:32:06 +08:00
parent eddf90f214
commit 3f47a3eaca
2 changed files with 8 additions and 9 deletions

View File

@ -115,7 +115,7 @@ class NewMarketController extends BaseController {
return;
}
if (!$this->isTestMode() || BoxOrder::isBuyed($account, $currBatchMeta['batch_id'])) {
if (!$this->isTestMode() && BoxOrder::isBuyed($buyerAddress, $currBatchMeta['batch_id'])) {
myself()->_rspErr(1, 'account can only choose 1 hero to purchase');
return;
}
@ -126,9 +126,10 @@ class NewMarketController extends BaseController {
$itemId = $type;
SqlHelper::insert
(myself()->_getMarketMysql(),
't_box_order_bag',
't_box_order',
array(
'batch_id' => $currBatchMeta['batch_id'],
'order_id' => $orderId,
'item_id' => $itemId,
'state' => 1,
'buyer_address' => $buyerAddress,
@ -163,7 +164,7 @@ class NewMarketController extends BaseController {
public function getNftList()
{
$account = getReqVal('account', '');
$nftDbList = Nft::getNftList($accont);
$nftDbList = Nft::getNftList($account);
$nftList = array();
foreach ($nftDbList as $nftDb) {
$nft = $this->toNftDto($nftDb);
@ -192,7 +193,7 @@ class NewMarketController extends BaseController {
private function toNftDto($nftDb)
{
$nft = array(
'token_id' => $nftDb['tokenId'],
'token_id' => $nftDb['token_id'],
'owner_address' => $nftDb['owner_address'],
'owner_name' => $nftDb['owner_name'],
'item_id' => $nftDb['item_id'],

View File

@ -11,15 +11,13 @@ class Nft extends BaseModel {
{
$nftList = array();
SqlHelper::ormSelect(
myself()->_getSelfMysql(),
myself()->_getMarketMysql(),
't_nft',
array(
'owner_address' => $account
),
function ($row) use(&$nftList) {
if ($row['item_num'] > 0) {
array_push($nftList, $row);
}
array_push($nftList, $row);
}
);
return $nftList;
@ -28,7 +26,7 @@ class Nft extends BaseModel {
public function getNft($tokenId)
{
$row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(),
myself()->_getMarketMysql(),
't_nft',
array(
'token_id' => $tokenId,