1
This commit is contained in:
parent
e2bd74e0f2
commit
bae6b49eac
@ -17,6 +17,7 @@ require_once('models/User.php');
|
||||
require_once('models/Avatar.php');
|
||||
require_once('models/ChipPlugin.php');
|
||||
require_once('models/ChipPage.php');
|
||||
require_once('models/Nft.php');
|
||||
require_once('services/NftService.php');
|
||||
require_once('services/FormulaService.php');
|
||||
require_once('services/ContractConfig.php');
|
||||
@ -186,7 +187,7 @@ class Hero extends BaseModel {
|
||||
$heroAtteMeta = \mt\EconomyAttribute::findByGrade($heroMeta['relationship'],$row['quality']);
|
||||
$unsealTime = $row['unseal_time'] ? $row['unseal_time'] : $row['createtime'];
|
||||
$validTime = $unsealTime + 86400 * $heroAtteMeta['validTime'] ;
|
||||
return array(
|
||||
$dto = array(
|
||||
'idx' => $row['idx'],
|
||||
'token_id' => $row['token_id'],
|
||||
'hero_uniid' => $row['idx'],
|
||||
@ -211,7 +212,18 @@ class Hero extends BaseModel {
|
||||
"current_times" => myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,$row['idx']),
|
||||
"total_times" => $heroAtteMeta['roundPerDay'],
|
||||
);
|
||||
|
||||
$dto['is_avatar'] = 0;
|
||||
if ($dto['token_id']){
|
||||
$nftList = Nft::getNftListByType(myself()->_getAddress(),Nft::HERO_TYPE);
|
||||
if (count($nftList) > 0){
|
||||
foreach ($nftList as $value){
|
||||
if ($value['token_id'] == $dto['token_id']){
|
||||
$dto['is_avatar'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $dto;
|
||||
}
|
||||
|
||||
public static function toDto($row)
|
||||
@ -302,6 +314,18 @@ class Hero extends BaseModel {
|
||||
// $nft_address = $contract ? $contract['hero'] : "";
|
||||
// }
|
||||
// $dto['nft_address'] = $nft_address;
|
||||
$dto['is_avatar'] = 0;
|
||||
if ($dto['token_id']){
|
||||
$nftList = Nft::getNftListByType(myself()->_getAddress(),Nft::HERO_TYPE);
|
||||
if (count($nftList) > 0){
|
||||
foreach ($nftList as $value){
|
||||
if ($value['token_id'] == $dto['token_id']){
|
||||
$dto['is_avatar'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $dto;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user