diff --git a/src/api/controllers/shop.controller.ts b/src/api/controllers/shop.controller.ts index 8453b2d..7e14495 100644 --- a/src/api/controllers/shop.controller.ts +++ b/src/api/controllers/shop.controller.ts @@ -41,6 +41,34 @@ class ShopController extends BaseController { return result } + @role('anon') + @router('post /weapp/shopList') + async shopList(req, res) { + let { start, limit } = req.params + limit = +limit || 10 + start = +start || 0 + let { opt, sort } = Shop.parseQueryParam(req.params) + let articles = await Shop.find(opt) + .sort(sort) + .skip(start) + .limit(limit) + let count = await Shop.count(opt) + let records: any = [] + for (let record of articles) { + records.push({ + id: record.id, + showName: record.showName, + logo: record.logo, + areaStr: record.areaStr + }) + } + return { + total: count, + start, + limit, + records + } + } /** * TODO:: 获取某店铺实时的活动信息