This commit is contained in:
aozhiwei 2022-03-09 17:53:56 +08:00
parent c7fa456447
commit 68da100e78
4 changed files with 5 additions and 9 deletions

View File

@ -78,6 +78,7 @@ class Gun(object):
['state', 0, '0已购买 1体验中'], ['state', 0, '0已购买 1体验中'],
['gun_lv', 0, '枪等级'], ['gun_lv', 0, '枪等级'],
['quality', 0, '品阶'], ['quality', 0, '品阶'],
['durability', 0, '耐久'],
['!attr', [Attr()], '属性'], ['!attr', [Attr()], '属性'],
['try_count', 0, '剩余体验次数 当state=1时才有意义'], ['try_count', 0, '剩余体验次数 当state=1时才有意义'],
['lock_type', 0, '0:无锁 1:升级 2:升阶'], ['lock_type', 0, '0:无锁 1:升级 2:升阶'],
@ -203,7 +204,6 @@ class Item(object):
['item_uniid', 0, '道具唯一id'], ['item_uniid', 0, '道具唯一id'],
['item_id', 0, '道具id'], ['item_id', 0, '道具id'],
['item_num', 0, '道具数量'], ['item_num', 0, '道具数量'],
['durability', 0, '耐久'],
['!attr', [Attr()], '属性'], ['!attr', [Attr()], '属性'],
] ]

View File

@ -141,7 +141,6 @@ CREATE TABLE `t_bag` (
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id', `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
`item_num` int(11) NOT NULL DEFAULT '0' COMMENT '数量', `item_num` int(11) NOT NULL DEFAULT '0' COMMENT '数量',
`durability` int(11) NOT NULL DEFAULT '0' COMMENT '耐久',
`rand_attr` mediumblob COMMENT '随机属性', `rand_attr` mediumblob COMMENT '随机属性',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` 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:升阶', `lock_type` int(11) NOT NULL DEFAULT '0' COMMENT '0:无锁 1:升级 2:升阶',
`unlock_time` int(11) NOT NULL DEFAULT '0' COMMENT '解锁时间', `unlock_time` int(11) NOT NULL DEFAULT '0' COMMENT '解锁时间',
`unlock_trade_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 '随机属性', `rand_attr` mediumblob COMMENT '随机属性',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',

View File

@ -62,7 +62,6 @@ class Bag extends BaseModel {
'item_uniid' => $row['idx'], 'item_uniid' => $row['idx'],
'item_id' => $row['item_id'], 'item_id' => $row['item_id'],
'item_num' => $row['item_num'], 'item_num' => $row['item_num'],
'durability' => $row['durability'],
'attr' => emptyReplace(json_decode($row['rand_attr'], true), array()), 'attr' => emptyReplace(json_decode($row['rand_attr'], true), array()),
); );
} }
@ -129,7 +128,6 @@ class Bag extends BaseModel {
'account_id' => myself()->_getAccountId(), 'account_id' => myself()->_getAccountId(),
'item_id' => $itemId, 'item_id' => $itemId,
'item_num' => 1, 'item_num' => 1,
'durability' => $itemMeta['init_durability'],
'rand_attr' => json_encode($randAttr), 'rand_attr' => json_encode($randAttr),
'createtime' => myself()->_getNowTime(), 'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime() 'modifytime' => myself()->_getNowTime()
@ -194,9 +192,4 @@ class Bag extends BaseModel {
); );
} }
public static function addDurability($itemUniId, $val)
{
}
} }

View File

@ -71,6 +71,7 @@ class Gun extends BaseModel {
'gun_lv' => $row['gun_lv'], 'gun_lv' => $row['gun_lv'],
'state' => $row['state'], 'state' => $row['state'],
'quality' => $row['quality'], 'quality' => $row['quality'],
'durability' => $row['durability'],
'attr' => $attr, 'attr' => $attr,
'try_count' => $row['try_count'], 'try_count' => $row['try_count'],
'lock_type' => $lockType, 'lock_type' => $lockType,
@ -98,6 +99,7 @@ class Gun extends BaseModel {
'gun_lv' => 1, 'gun_lv' => 1,
'quality' => 1, 'quality' => 1,
'state' => self::GETED_STATE, 'state' => self::GETED_STATE,
'durability' => $gunMeta['init_durability'],
'rand_attr' => json_encode($randAttr), 'rand_attr' => json_encode($randAttr),
'lock_type' => self::NO_LOCK, 'lock_type' => self::NO_LOCK,
'unlock_time' => 0, 'unlock_time' => 0,
@ -133,6 +135,7 @@ class Gun extends BaseModel {
'quality' => 1, 'quality' => 1,
'state' => self::TRY_STATE, 'state' => self::TRY_STATE,
'try_count' => $tryCount, 'try_count' => $tryCount,
'durability' => $gunMeta['init_durability'],
'rand_attr' => json_encode($randAttr), 'rand_attr' => json_encode($randAttr),
'lock_type' => self::NO_LOCK, 'lock_type' => self::NO_LOCK,
'unlock_time' => 0, 'unlock_time' => 0,