1
This commit is contained in:
parent
ba90c85676
commit
2c1f98ad82
42
webapp/controller/OutAppNftController.class.php
Normal file
42
webapp/controller/OutAppNftController.class.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
use phpcommon\SqlHelper;
|
||||||
|
require_once('models/Nft.php');
|
||||||
|
|
||||||
|
use models\Nft;
|
||||||
|
class OutAppNftController extends BaseController {
|
||||||
|
|
||||||
|
public function getNftList(){
|
||||||
|
$address = getReqVal('address', '');
|
||||||
|
$type = getReqVal('type', '');
|
||||||
|
if ($type){
|
||||||
|
$nftList = Nft::getNftListByType($address,$type);
|
||||||
|
}else{
|
||||||
|
$nftList = Nft::getNftList($address);
|
||||||
|
}
|
||||||
|
$listInfo = array();
|
||||||
|
if ($nftList){
|
||||||
|
foreach ($nftList as $nft) {
|
||||||
|
$image = 'https://www.cebg.games/res/avatars/' . $nft['item_id'] . '.png';
|
||||||
|
$full_image = 'https://www.cebg.games/res/avatars/full_' . $nft['item_id'] . '.png';
|
||||||
|
$info = array(
|
||||||
|
"idx" => $nft['idx'],
|
||||||
|
"owner_address" => $nft['owner_address'],
|
||||||
|
"item_id" => $nft['item_id'],
|
||||||
|
"token_id" => $nft['token_id'],
|
||||||
|
"token_type" => $nft['token_type'],
|
||||||
|
"contract_address" => $nft['contract_address'],
|
||||||
|
'image' => $image,
|
||||||
|
'full_image' => $full_image,
|
||||||
|
"details" => array(),
|
||||||
|
);
|
||||||
|
array_push($listInfo,$info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_rspData(array(
|
||||||
|
'nfts' => $listInfo,
|
||||||
|
));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user