diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 8596ef9c..e7e4737d 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -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 */; diff --git a/webapp/models/BattleHistory.php b/webapp/models/BattleHistory.php index f9782f10..ec4de40e 100644 --- a/webapp/models/BattleHistory.php +++ b/webapp/models/BattleHistory.php @@ -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){ diff --git a/webapp/services/LogService.php b/webapp/services/LogService.php index 76cb8938..48f13610 100644 --- a/webapp/services/LogService.php +++ b/webapp/services/LogService.php @@ -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;