$boxDb['token_id'], 'image_box_1' => 'https://www.cebg.games/res/nfts/box_1.png', 'image_box_2' => 'https://www.cebg.games/res/nfts/box_2.png', 'image_box_3' => 'https://www.cebg.games/res/nfts/box_3.png', )); } myself()->_rspData(array( 'rows' => $rows )); } public static function openPhase3Box($account, $boxId) { $boxDb = Phase3Box::find($account); if (!$boxDb) { myself()->_rspErr(100, 'box not exists'); return; } if ($boxDb['state'] == Phase3Box::INIT_STATE) { Phase3Box::give($account); } myself()->_rspOk(); } public static function queryPhase3Box($account, $boxId) { $boxDb = Phase3Box::find($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; } } } }