diff --git a/doc/_common.py b/doc/_common.py index 4ac6bc2c..c87a6a96 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -288,7 +288,7 @@ class Hero(object): ['unseal_time', 0, '解封时间'], ['valid_time', 0, '最大有效时间'], ['valid_lefttime', 0, '剩余有效时间'], - ['is_new', 0, '0:展示红点 1:不用展示'], + ['is_old', 0, '0:展示红点 1:不用展示'], ] class LevelingHero(object): @@ -335,7 +335,7 @@ class Item(object): ['item_uniid', 0, '道具唯一id'], ['item_id', 0, '道具id'], ['item_num', 0, '道具数量'], - ['is_new', 0, '0:展示红点 1:不用展示'], + ['is_old', 0, '0:展示红点 1:不用展示'], ['!attr', [Attr()], '属性'], ] @@ -892,7 +892,7 @@ class Chip(object): ['!rand_attr', [ChipAttr()], '属性'], ['tags', '', '1:Gen状态'], ['quality', '', '品阶'], - ['is_new', '', '0:展示红点 1:不用展示'], + ['is_old', '', '0:展示红点 1:不用展示'], ] class ChipPro(object): diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 899817db..a3232881 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -174,7 +174,7 @@ CREATE TABLE `t_hero` ( `wealth_attr` mediumblob COMMENT '财富值属性', `seal_type` int(11) NOT NULL DEFAULT '0' COMMENT '0:未封存 1:已封存', `unseal_time` int(11) NOT NULL DEFAULT '0' COMMENT '解开封时间', - `is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ', + `is_old` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ', PRIMARY KEY (`idx`), UNIQUE KEY `token_id` (`token_id`), @@ -221,7 +221,7 @@ CREATE TABLE `t_bag` ( `rand_attr` mediumblob COMMENT '随机属性', `today_get_gold` bigint NOT NULL DEFAULT '0' COMMENT '金币', `last_get_gold_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后获取金币的时间', - `is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ', + `is_old` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), @@ -258,7 +258,7 @@ CREATE TABLE `t_chip` ( `activate` int(11) NOT NULL DEFAULT '0' COMMENT '是否激活 1:已初始激活', `quality` int(11) NOT NULL DEFAULT '0' COMMENT '品阶', `wealth_attr` mediumblob COMMENT '财富值属性', - `is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ', + `is_old` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', diff --git a/sql/gamedb2006_migrate_240423_01.sql b/sql/gamedb2006_migrate_240423_01.sql index 286e13c3..573a95cc 100644 --- a/sql/gamedb2006_migrate_240423_01.sql +++ b/sql/gamedb2006_migrate_240423_01.sql @@ -1,8 +1,8 @@ begin; -alter table t_hero add column `is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 '; -alter table t_chip add column `is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 '; -alter table t_bag add column `is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 '; +alter table t_hero add column `is_old` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 '; +alter table t_chip add column `is_old` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 '; +alter table t_bag add column `is_old` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 '; diff --git a/webapp/models/Bag.php b/webapp/models/Bag.php index fd072e96..5b7e2fe3 100644 --- a/webapp/models/Bag.php +++ b/webapp/models/Bag.php @@ -100,7 +100,7 @@ class Bag extends BaseModel { 'attr' => emptyReplace(json_decode($row['rand_attr'], true), array()), 'today_get_gold' => $todayGetGold, 'last_get_gold_time' => $lastGetGoldTime, - 'is_new' => $row['is_new'], + 'is_old' => $row['is_old'], ); } @@ -216,12 +216,6 @@ class Bag extends BaseModel { } if ($itemMeta['cannot_stack']) { $randAttr = array(); - if (mt\Item::isRandAttrItem($itemMeta)) { - $qualityMeta = mt\ChipQuality::getByQuality($itemMeta['quality']); - if ($qualityMeta) { - $randAttr = mt\ChipQuality::getRandAttr($qualityMeta); - } - } $fieldsKv = array( 'item_id' => $itemId, 'item_num' => 1, diff --git a/webapp/models/Chip.php b/webapp/models/Chip.php index 5f2afd38..2d53267b 100644 --- a/webapp/models/Chip.php +++ b/webapp/models/Chip.php @@ -196,7 +196,7 @@ class Chip extends BaseModel 'rand_attr'=> $rand_attr, 'quality'=> $row['quality'], 'attribute' => $attribute, - 'is_new' => $row['is_new'], + 'is_old' => $row['is_old'], ); $dto['chip_name'] = mt\Item::get($row['item_id'])?mt\Item::get($row['item_id'])['name']:'XXX'; // $nft_address = ''; diff --git a/webapp/models/Hero.php b/webapp/models/Hero.php index ec51b3dc..57db2d21 100644 --- a/webapp/models/Hero.php +++ b/webapp/models/Hero.php @@ -242,7 +242,7 @@ class Hero extends BaseModel { $validTime - myself()->_getNowTime()), 'valid_time' => max(0, 86400 * $heroAtteMeta['validTime']), - 'is_new' => $row['is_new'], + 'is_old' => $row['is_old'], ); } @@ -323,7 +323,7 @@ class Hero extends BaseModel { $validTime - myself()->_getNowTime()), 'valid_time' => max(0, 86400 * $heroAtteMeta['validTime']), - 'is_new' => $row['is_new'], + 'is_old' => $row['is_old'], ); // $nft_address = ''; diff --git a/webapp/mt/ChipAttr.php b/webapp/mt/ChipAttr.php deleted file mode 100644 index fcef3d37..00000000 --- a/webapp/mt/ChipAttr.php +++ /dev/null @@ -1,119 +0,0 @@ -$item){ - $attr_pool['num_weight'][$key] = explode(':',$item); - } - $weight = 0; - $tempData = array (); - foreach ($attr_pool['num_weight'] as $one) { - $weight += $one[1]; - for ($i = 0; $i < $one[1]; $i++) { - $tempData[] = $one; - - } - } - $k = rand(0, $weight -1); - $attr_pool['val'] = $tempData[$k][0]; - unset($attr_pool['num_weight']); - } - return $attr_pool; - } - - - -// public static function generateOneAttr($type){ -//// $itemMeta = Item::get($item_id); -//// return self::getAttrPool(self::getAttrByItemId($itemMeta['id'])); -// -//// $attr_pool = self::getAttrPool(self::getAttrByItemId($itemMeta['id'])); -//// $attr = emptyReplace(json_decode($chip['rand_attr'], true), array()); -//// array_push($attr,$attr_pool); -//// return $attr; -// if ($type == self::ROLE_CHIP_SUBTYPE){ -// $chip = self::getNodeChip(); -// $attr = $chip[ array_rand($chip)]; -// return self::getAttrPool($attr); -// } -// if ($type == self::GUN_CHIP_SUBTYPE){ -// $chip = self::getGunChip(); -// $attr = $chip[ array_rand($chip)]; -// return self::getAttrPool($attr); -// } -// return array(); -// } -// -// -// -// private static function getNodeChip(){ -// $node_chip = array(); -// foreach (self::getMetaList() as $item){ -// if ($item['chip_type'] == self::ROLE_CHIP_SUBTYPE){ -// array_push($node_chip,$item); -// } -// } -// return $node_chip; -// } -// -// private static function getGunChip(){ -// $gun_chip = array(); -// foreach (self::getMetaList() as $item){ -// if ($item['chip_type'] == self::GUN_CHIP_SUBTYPE){ -// array_push($gun_chip,$item); -// } -// } -// return $gun_chip; -// } - - public static function getAttrByItemId($item_id){ - foreach (self::getMetaList() as $item){ - if ($item['item_id'] == $item_id){ - return $item; - } - } - } - -} \ No newline at end of file diff --git a/webapp/mt/ChipQuality.php b/webapp/mt/ChipQuality.php deleted file mode 100644 index bef844b8..00000000 --- a/webapp/mt/ChipQuality.php +++ /dev/null @@ -1,66 +0,0 @@ - $item[0], - 'type' => $item[1], - 'val' => rand($item[2], $item[3]) - )); - } - ++$i; - } - return $result; - } - - protected static function getMetaList() - { - if (!self::$metaList) { - self::$metaList = getMetaTable('chipQuality@chipQuality.php'); - } - return self::$metaList; - } - - protected static function mustBeQualityHash() - { - if (!self::$qualityHash) { - self::$qualityHash = array(); - foreach (self::getMetaList() as $meta) { - self::$qualityHash[$meta['quality']] = $meta; - } - } - } - - protected static $metaList; - protected static $qualityHash; - -}