From 47e5480e617bcfffc74ba3a394bd5a16b9710162 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 10 Jul 2020 19:09:09 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 3 ++- webapp/controller/ShopController.class.php | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index bf7c416..05c87d6 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -118,7 +118,8 @@ CREATE TABLE `bag` ( `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modify_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), - UNIQUE KEY `item_uuid` (`accountid`, `id`) + UNIQUE KEY `item_uuid` (`accountid`, `id`), + KEY `accountid` (`accountid`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index f4cb7b5..06aa385 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -28,7 +28,6 @@ class ShopController{ )); return $conn; } - protected function getItem($item_id) { $g_conf_item_cluster = require('../res/item@item.php'); @@ -47,6 +46,23 @@ class ShopController{ return $it; } + protected function getItemEx(&$g_conf_item_cluster, $item_id) + { + $item_conf = getItemConfig($g_conf_item_cluster, $item_id); + $it = array( + 'id' => $item_conf['id'], + 'price' => $item_conf['gold'], + 'dprice' => $item_conf['diamond_price'], + 'discount' => $item_conf['discount'], + 'shop_type' => $item_conf['shop_type'], + 'type' => $item_conf['fuction'], + 'bug_groupnum' => $item_conf['bug_groupnum'], + 'shop_list' => $item_conf['shop_list'], + 'bug_groupnum' => $item_conf['bug_groupnum'], + ); + return $it; + } + protected function getShop($shop_id) { $g_conf_shop_cluster = require('../res/shop@shop.php'); @@ -161,7 +177,7 @@ class ShopController{ $diamond_shop = array(); $num = 1; foreach($g_conf_item_cluster as $items) { - $it = $this->getItem($items['id']); + $it = $this->getItemEx($g_conf_item_cluster, $items['id']); $status = 0; foreach($rows as $r) { if ($r['id'] != $it['id']) {