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

Method userCount

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

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected