From 27173d1eeaf1f49d691639b7884ee9305d75d928 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 29 Nov 2021 13:05:00 +0800 Subject: [PATCH] add shop_data table --- doc/Shop.py | 38 +++------------------- sql/gamedb.sql | 15 +++++++++ webapp/controller/ShopController.class.php | 17 +--------- 3 files changed, 21 insertions(+), 49 deletions(-) diff --git a/doc/Shop.py b/doc/Shop.py index 3b1bb94..1a52a6d 100644 --- a/doc/Shop.py +++ b/doc/Shop.py @@ -7,46 +7,18 @@ class Shop(object): def __init__(self): self.apis = [ { - 'name': 'buyHero', + 'name': 'buy', 'desc': '购买英雄', - 'group': 'Hero', - 'url': 'webapp/index.php?c=Hero&a=buyHero', + 'group': 'Shop', + 'url': 'webapp/index.php?c=Shop&a=buy', 'params': [ _common.ReqHead(), - ['hero_id', '', '英雄id'], - ['buy_type', '', '购买类型0:指购买英雄 1:购买英雄和皮肤'], + ['shop_id', '', '商店id'], + ['goods_id', '', '商品id'], ], 'response': [ _common.RspHead(), ['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(), '枪支皮肤信息'] - ] - }, ] diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 711dcdc..35ae5e3 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -175,4 +175,19 @@ CREATE TABLE `dyndata` ( ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!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 diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 4ed163f..734b5be 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -67,22 +67,7 @@ class ShopController extends BaseAuthedController { )); } - public function buyHeroSkin() - { - $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() + public function buy() { }