This commit is contained in:
hujiabin 2022-10-26 21:00:13 +08:00
parent 3f2daadade
commit 2250412e03
3 changed files with 34 additions and 11 deletions

View File

@ -606,7 +606,7 @@ CREATE TABLE `t_nft_active` (
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `token_id_daytime` (`token_id`, `daytime`,`token_type`),
UNIQUE KEY `uniid_daytime_type` (`uniid`, `daytime`,`token_type`),
KEY `account_id_token_type` (`account_id`,`token_type`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

View File

@ -23,15 +23,38 @@ class BattleHistory extends BaseModel
public static function getMyBattleHistoryByMode($mode)
{
$row = SqlHelper::ormSelect(
myself()->_getSelfMysql(),
't_battle_history',
array(
'account_id' => myself()->_getAccountId(),
'match_mode' => $mode,
)
);
return $row;
if ($mode == 1) {
$row1 = SqlHelper::ormSelect(
myself()->_getSelfMysql(),
't_battle_history',
array(
'account_id' => myself()->_getAccountId(),
'match_mode' => 0,
)
);
$row2 = SqlHelper::ormSelect(
myself()->_getSelfMysql(),
't_battle_history',
array(
'account_id' => myself()->_getAccountId(),
'match_mode' => 1,
)
);
$row = array_merge($row1,$row2);
return $row;
}elseif($mode == 2){
$row = SqlHelper::ormSelect(
myself()->_getSelfMysql(),
't_battle_history',
array(
'account_id' => myself()->_getAccountId(),
'match_mode' => 2,
)
);
return $row;
}else{
return array();
}
}
public static function toDto($row){

View File

@ -178,7 +178,7 @@ class LogService extends BaseService
$info = array(
'nft_unique_id' => $nft['idx'], //NFT idx
'nft_token_id' => $nft['token_id']?$nft['token_id']:null, //NFT token ID
'nft_item_id' => $nft['item_id'], //NFT item ID
'nft_item_id' => $nft['item_id']?$nft['item_id']:null, //NFT item ID
'nft_info' => json_encode($nft),
);
return $info;