MCPcopy Create free account
hub / github.com/bailicangdu/node-elm / orderCount

Method orderCount

controller/statis/statis.js:120–145  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

118 }
119 }
120 async orderCount(req, res, next){
121 const date = req.params.date;
122 if (!date) {
123 console.log('参数错误')
124 res.send({
125 status: 0,
126 type: 'ERROR_PARAMS',
127 message: '参数错误'
128 })
129 return
130 }
131 try{
132 const count = await OrderModel.find({formatted_created_at: eval('/^' + date + '/gi')}).count()
133 res.send({
134 status: 1,
135 count,
136 })
137 }catch(err){
138 console.log('获取当天订单数量失败');
139 res.send({
140 status: 0,
141 type: 'ERROR_GET_ORDER_COUNT',
142 message: '获取当天订单数量失败'
143 })
144 }
145 }
146}
147
148export default new Statis()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected