1
This commit is contained in:
parent
84081ba6bd
commit
aa110d2ead
@ -41,13 +41,48 @@ class Phase3BoxService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($boxDb['state'] == Phase3Box::INIT_STATE) {
|
if ($boxDb['state'] == Phase3Box::INIT_STATE) {
|
||||||
|
Phase3Box::give($account);
|
||||||
}
|
}
|
||||||
myself()->_rspOk();
|
myself()->_rspOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function queryPhase3Box($account, $boxId)
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user