add shop_data table

This commit is contained in:
aozhiwei 2021-11-29 13:05:00 +08:00
parent d2c5cb2481
commit 27173d1eea
3 changed files with 21 additions and 49 deletions

View File

@ -7,46 +7,18 @@ class Shop(object):
def __init__(self): def __init__(self):
self.apis = [ self.apis = [
{ {
'name': 'buyHero', 'name': 'buy',
'desc': '购买英雄', 'desc': '购买英雄',
'group': 'Hero', 'group': 'Shop',
'url': 'webapp/index.php?c=Hero&a=buyHero', 'url': 'webapp/index.php?c=Shop&a=buy',
'params': [ 'params': [
_common.ReqHead(), _common.ReqHead(),
['hero_id', '', '英雄id'], ['shop_id', '', '商店id'],
['buy_type', '', '购买类型0指购买英雄 1购买英雄和皮肤'], ['goods_id', '', '商品id'],
], ],
'response': [ 'response': [
_common.RspHead(), _common.RspHead(),
['award', _common.Award(), '奖励信息'], ['award', _common.Award(), '奖励信息'],
] ]
}, },
{
'name': 'buySkin',
'desc': '购买皮肤',
'group': 'Hero',
'url': 'webapp/index.php?c=Hero&a=buySkin',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'name': 'buyGunSkin',
'desc': '购买枪支皮肤buyGunSkin',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=buyGunSkin',
'params': [
_common.ReqHead(),
['gun_id', 0, '枪支id'],
['skin_id', 0, '皮肤id'],
['goodsID', 0, '商品id'],
],
'response': [
_common.RspHead(),
['data', _common.GunSkin(), '枪支皮肤信息']
]
},
] ]

View File

@ -175,4 +175,19 @@ CREATE TABLE `dyndata` (
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `shop_data`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shop_data` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
`shop_id` int(11) NOT NULL DEFAULT '0' COMMENT '商店id',
`blobdata` mediumblob COMMENT '商店数据json',
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modify_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
KEY `account_id` (`account_id`),
UNIQUE KEY `account_id_shop_id` (`account_id`, `shop_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- Dump completed on 2015-08-19 18:51:22 -- Dump completed on 2015-08-19 18:51:22

View File

@ -67,22 +67,7 @@ class ShopController extends BaseAuthedController {
)); ));
} }
public function buyHeroSkin() public function buy()
{
$skinId = getReqVal('skin_id', 0);
$skinMeta = mt\Item::get($skinId);
if (!$skinMeta) {
$this->_rspErr(1, 'skin_id参数错误');
return;
}
if (!mt\Item::isType($skinMeta, mt\Item::SKIN_TYPE)){
$this->_rspErr(1, 'skin_id参数错误');
return;
}
HeroSkin::addSkin($skinId);
}
public function buyGunSkin()
{ {
} }