From 68da100e78ed7b5ded451ea5f421265d695be4b5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 9 Mar 2022 17:53:56 +0800 Subject: [PATCH] 1 --- doc/_common.py | 2 +- sql/gamedb.sql | 2 +- webapp/models/Bag.php | 7 ------- webapp/models/Gun.php | 3 +++ 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/doc/_common.py b/doc/_common.py index 6ee56341..2a0ed45e 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -78,6 +78,7 @@ class Gun(object): ['state', 0, '0:已购买 1:体验中'], ['gun_lv', 0, '枪等级'], ['quality', 0, '品阶'], + ['durability', 0, '耐久'], ['!attr', [Attr()], '属性'], ['try_count', 0, '剩余体验次数 当state=1时才有意义'], ['lock_type', 0, '0:无锁 1:升级 2:升阶'], @@ -203,7 +204,6 @@ class Item(object): ['item_uniid', 0, '道具唯一id'], ['item_id', 0, '道具id'], ['item_num', 0, '道具数量'], - ['durability', 0, '耐久'], ['!attr', [Attr()], '属性'], ] diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 915fbc56..a1acecdf 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -141,7 +141,6 @@ CREATE TABLE `t_bag` ( `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id', `item_num` int(11) NOT NULL DEFAULT '0' COMMENT '数量', - `durability` int(11) NOT NULL DEFAULT '0' COMMENT '耐久', `rand_attr` mediumblob COMMENT '随机属性', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', @@ -169,6 +168,7 @@ CREATE TABLE `t_gun` ( `lock_type` int(11) NOT NULL DEFAULT '0' COMMENT '0:无锁 1:升级 2:升阶', `unlock_time` int(11) NOT NULL DEFAULT '0' COMMENT '解锁时间', `unlock_trade_time` int(11) NOT NULL DEFAULT '0' COMMENT '出售解锁时间', + `durability` int(11) NOT NULL DEFAULT '0' COMMENT '耐久', `rand_attr` mediumblob COMMENT '随机属性', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', diff --git a/webapp/models/Bag.php b/webapp/models/Bag.php index 8ca8fd2d..9ed0a12f 100644 --- a/webapp/models/Bag.php +++ b/webapp/models/Bag.php @@ -62,7 +62,6 @@ class Bag extends BaseModel { 'item_uniid' => $row['idx'], 'item_id' => $row['item_id'], 'item_num' => $row['item_num'], - 'durability' => $row['durability'], 'attr' => emptyReplace(json_decode($row['rand_attr'], true), array()), ); } @@ -129,7 +128,6 @@ class Bag extends BaseModel { 'account_id' => myself()->_getAccountId(), 'item_id' => $itemId, 'item_num' => 1, - 'durability' => $itemMeta['init_durability'], 'rand_attr' => json_encode($randAttr), 'createtime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime() @@ -194,9 +192,4 @@ class Bag extends BaseModel { ); } - public static function addDurability($itemUniId, $val) - { - - } - } diff --git a/webapp/models/Gun.php b/webapp/models/Gun.php index 6df56f75..1cd5c514 100644 --- a/webapp/models/Gun.php +++ b/webapp/models/Gun.php @@ -71,6 +71,7 @@ class Gun extends BaseModel { 'gun_lv' => $row['gun_lv'], 'state' => $row['state'], 'quality' => $row['quality'], + 'durability' => $row['durability'], 'attr' => $attr, 'try_count' => $row['try_count'], 'lock_type' => $lockType, @@ -98,6 +99,7 @@ class Gun extends BaseModel { 'gun_lv' => 1, 'quality' => 1, 'state' => self::GETED_STATE, + 'durability' => $gunMeta['init_durability'], 'rand_attr' => json_encode($randAttr), 'lock_type' => self::NO_LOCK, 'unlock_time' => 0, @@ -133,6 +135,7 @@ class Gun extends BaseModel { 'quality' => 1, 'state' => self::TRY_STATE, 'try_count' => $tryCount, + 'durability' => $gunMeta['init_durability'], 'rand_attr' => json_encode($randAttr), 'lock_type' => self::NO_LOCK, 'unlock_time' => 0,