diff --git a/doc/Shop.py b/doc/Shop.py index 224040c6..60c5250f 100644 --- a/doc/Shop.py +++ b/doc/Shop.py @@ -60,6 +60,7 @@ class Shop(object): 'url': 'webapp/index.php?c=Shop&a=getGoodsList', 'params': [ _common.ReqHead(), + ['shop_id', 0, '商店id 0: 所有商店(较慢)'], ], 'response': [ _common.RspHead(), diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 271f22a6..a25344c5 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -113,7 +113,13 @@ class ShopController extends BaseAuthedController public function getGoodsList() { - $goodsList = mt\ShopGoods::all(); + $shop_id = getReqVal('shop_id', 0); + if ($shop_id == 0) { + $goodsList = mt\ShopGoods::all(); + } else { + $goodsList = mt\ShopGoods::getGoodsList($shop_id); + } + $goodsList = $goodsList ? $goodsList : array(); $buyRecordHash = ShopBuyRecord::allToHash(); @@ -757,7 +763,7 @@ class ShopController extends BaseAuthedController ) ); } - + public function openBlindBox() { $account = $this->_getAccountId();