diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 36e77978..242a408e 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1712,7 +1712,7 @@ CREATE TABLE `t_hash_rate` ( `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), - UNIQUE KEY `account_task_id` (`account_id`, `task_id`) + UNIQUE KEY `account_period_task_id` (`account_id`,`period`, `task_id`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- diff --git a/sql/gamedb2006_migrate_231228_01.sql b/sql/gamedb2006_migrate_231228_01.sql index a76e3fa3..f475a938 100644 --- a/sql/gamedb2006_migrate_231228_01.sql +++ b/sql/gamedb2006_migrate_231228_01.sql @@ -9,7 +9,7 @@ CREATE TABLE `t_hash_rate` ( `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), - UNIQUE KEY `account_task_id` (`account_id`, `task_id`) + UNIQUE KEY `account_period_task_id` (`account_id`,`period`, `task_id`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; CREATE TABLE `t_hash_rate_battle_data` ( diff --git a/webapp/services/HashRateService.php b/webapp/services/HashRateService.php index f43e97aa..e4d462d1 100644 --- a/webapp/services/HashRateService.php +++ b/webapp/services/HashRateService.php @@ -177,7 +177,7 @@ class HashRateService extends BaseService private function getWeaponsSlotData($taskMate){ $val = 0; $battleData = $this->internalGetBattleData($taskMate); - $slotData = $battleData['weapons_slot_data'] ? $battleData['weapons_slot_data'] : array(); + $slotData = isset($battleData['weapons_slot_data']) ? $battleData['weapons_slot_data'] : array(); if (array_key_exists($taskMate['condition'],$slotData)){ $val = $slotData[$taskMate['condition']]; }