(req, res, next)
| 66 | } |
| 67 | } |
| 68 | async userCount(req, res, next){ |
| 69 | const date = req.params.date; |
| 70 | if (!date) { |
| 71 | console.log('参数错误') |
| 72 | res.send({ |
| 73 | status: 0, |
| 74 | type: 'ERROR_PARAMS', |
| 75 | message: '参数错误' |
| 76 | }) |
| 77 | return |
| 78 | } |
| 79 | try{ |
| 80 | const count = await UserInfoModel.find({registe_time: eval('/^' + date + '/gi')}).count() |
| 81 | res.send({ |
| 82 | status: 1, |
| 83 | count, |
| 84 | }) |
| 85 | }catch(err){ |
| 86 | console.log('获取当天注册人数失败'); |
| 87 | res.send({ |
| 88 | status: 0, |
| 89 | type: 'ERROR_GET_USER_REGISTE_COUNT', |
| 90 | message: '获取当天注册人数失败' |
| 91 | }) |
| 92 | } |
| 93 | } |
| 94 | async adminCount(req, res, next){ |
| 95 | const date = req.params.date; |
| 96 | if (!date) { |
nothing calls this directly
no outgoing calls
no test coverage detected