136 lines
2.6 KiB
PHP
136 lines
2.6 KiB
PHP
<?php
|
|
|
|
require_once('mt/Parameter.php');
|
|
require_once('mt/Item.php');
|
|
require_once('mt/Drop.php');
|
|
require_once('mt/Hero.php');
|
|
|
|
require_once('models/Bag.php');
|
|
require_once('models/Hero.php');
|
|
require_once('models/Gun.php');
|
|
require_once('models/Nft.php');
|
|
require_once('models/Transaction.php');
|
|
|
|
require_once('services/AwardService.php');
|
|
require_once('services/PropertyChgService.php');
|
|
|
|
require_once('services/NameService.php');
|
|
|
|
use phpcommon\SqlHelper;
|
|
use models\Bag;
|
|
use models\Hero;
|
|
use models\Gun;
|
|
use models\Nft;
|
|
use models\Transaction;
|
|
|
|
class BlockChainController extends BaseAuthedController {
|
|
|
|
public function getTransactionList()
|
|
{
|
|
$trans = array();
|
|
foreach (Transaction::all() as $tran) {
|
|
array_push(
|
|
$trans,
|
|
array(
|
|
'trans_id' => $tran['trans_id'],
|
|
'item_id' => $tran['item_id'],
|
|
'action' => Transaction::getActionDesc($tran['action']),
|
|
'status' => Transaction::getActionDesc($tran['status']),
|
|
'time' => $tran['createtime'],
|
|
)
|
|
);
|
|
}
|
|
$this->_rspData(array(
|
|
'transactions' => $trans
|
|
));
|
|
}
|
|
|
|
public function active721Nft()
|
|
{
|
|
$type = getReqVal('type', 0);
|
|
$uniid = getReqVal('uniid', 0);
|
|
switch ($type) {
|
|
case 1:
|
|
{
|
|
$heroDb = Hero::find($uuid);
|
|
if (!$heroDb) {
|
|
myself()->_rspErr(1, 'hero not found');
|
|
return;
|
|
}
|
|
if ($heroDb['token_id']) {
|
|
myself()->_rspErr(1, 'already activated');
|
|
return;
|
|
}
|
|
|
|
}
|
|
break;
|
|
case 2:
|
|
{
|
|
$gunDb = Gun::find($uuid);
|
|
if (!$gunDb) {
|
|
myself()->_rspErr(1, 'gun not found');
|
|
return;
|
|
}
|
|
}
|
|
break;
|
|
default:
|
|
{
|
|
myself()->_rspErr(1, 'type param error');
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
public function active1155Nft()
|
|
{
|
|
|
|
}
|
|
|
|
public function reportActiveResult()
|
|
{
|
|
|
|
}
|
|
|
|
public function evolve721Nft()
|
|
{
|
|
|
|
}
|
|
|
|
public function reportEvolve721NftResult()
|
|
{
|
|
|
|
}
|
|
|
|
public function evolveChip()
|
|
{
|
|
|
|
}
|
|
|
|
public function reportEvolveChipResult()
|
|
{
|
|
|
|
}
|
|
|
|
public function mintShardBatchUser()
|
|
{
|
|
|
|
}
|
|
|
|
public function reportMintShardBatchUserResult()
|
|
{
|
|
|
|
}
|
|
|
|
public function shardMixByUser()
|
|
{
|
|
|
|
}
|
|
|
|
public function reportShardMixByUserResult()
|
|
{
|
|
|
|
}
|
|
|
|
}
|