From 56c32f7a698ac70e4894ca5b06741b23eb8a13fd Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Tue, 21 May 2024 17:18:15 +0800 Subject: [PATCH] 1 --- .../gamedb2006_migrate_240508_01.sql | 0 sql/gamedb2006_migrate_240521_01.sql | 16 ++++++++++++++++ webapp/models/Hero.php | 4 ++++ 3 files changed, 20 insertions(+) rename sql/{ => archived}/gamedb2006_migrate_240508_01.sql (100%) create mode 100644 sql/gamedb2006_migrate_240521_01.sql diff --git a/sql/gamedb2006_migrate_240508_01.sql b/sql/archived/gamedb2006_migrate_240508_01.sql similarity index 100% rename from sql/gamedb2006_migrate_240508_01.sql rename to sql/archived/gamedb2006_migrate_240508_01.sql diff --git a/sql/gamedb2006_migrate_240521_01.sql b/sql/gamedb2006_migrate_240521_01.sql new file mode 100644 index 00000000..8b7362d7 --- /dev/null +++ b/sql/gamedb2006_migrate_240521_01.sql @@ -0,0 +1,16 @@ +begin; + +CREATE TABLE `t_sub_user_bind` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `org_account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '初始账号id', + `cur_account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '最新账号id', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `org_account_id` (`org_account_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + + +insert into version (version) values(2024050801); + +commit; diff --git a/webapp/models/Hero.php b/webapp/models/Hero.php index 4adb5447..1a66a037 100644 --- a/webapp/models/Hero.php +++ b/webapp/models/Hero.php @@ -337,6 +337,8 @@ class Hero extends BaseModel { public static function mallInfo($row){ $attr = emptyReplace(json_decode($row['rand_attr'], true), array()); + $heroMeta = \mt\Item::get($row['hero_id']); + $heroAtteMeta = \mt\EconomyAttribute::findByGrade($heroMeta['relationship'],$row['quality']); return array( 'idx' => $row['idx'], 'token_id' => $row['token_id'], @@ -352,6 +354,8 @@ class Hero extends BaseModel { 'lucky' => self::getHeroLucky($row), 'wealth' => self::getHeroWealth($row), 'ability' => self::abilityInfo($row), + 'valid_time' => max(0, + 86400 * $heroAtteMeta['validTime']), ); }