This commit is contained in:
aozhiwei 2022-06-23 17:19:42 +08:00
parent 84081ba6bd
commit aa110d2ead

View File

@ -41,13 +41,48 @@ class Phase3BoxService {
return;
}
if ($boxDb['state'] == Phase3Box::INIT_STATE) {
Phase3Box::give($account);
}
myself()->_rspOk();
}
public static function queryPhase3Box($account, $boxId)
{
myself()->_rspOk();
$boxDb = Phase3Box::all($account);
if (!$boxDb) {
myself()->_rspErr(100, 'box not exists');
return;
}
if ($boxDb['state'] == Phase3Box::INIT_STATE) {
myself()->_rspData(array(
'state' => 0
));
return;
}
if ($boxDb['cec'] > 0) {
myself()->_rspData(array(
'state' => 1,
'cec' => $boxDb['cec']
));
return;
} else {
$nftDb = Nft::getNft($boxDb['token_id']);
if ($nftDb) {
myself()->_rspData(array(
'state' => 1,
'cec' => 0,
'nfts' => array(
Nft::toDto($nftDb)
)
));
return;
} else {
myself()->_rspData(array(
'state' => 0
));
return;
}
}
}
}