add shop list api for weapp
This commit is contained in:
parent
84b7e7ee16
commit
d3e76d8787
@ -41,6 +41,34 @@ class ShopController extends BaseController {
|
|||||||
|
|
||||||
return result
|
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:: 获取某店铺实时的活动信息
|
* TODO:: 获取某店铺实时的活动信息
|
||||||
|
Loading…
x
Reference in New Issue
Block a user