Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion controller/shopping/shop.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class Shop extends AddressComponent{
}

try{
const restaurants = await ShopModel.find({name: eval('/' + keyword + '/gi')}, '-_id').limit(50);
const restaurants = await ShopModel.find({name: new RegExp(String(keyword), 'gi')}, '-_id').limit(50);
if (restaurants.length) {
const [latitude, longitude] = geohash.split(',');
const from = latitude + ',' + longitude;
Expand Down
6 changes: 3 additions & 3 deletions controller/statis/statis.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Statis {
return
}
try{
const count = await UserInfoModel.find({registe_time: eval('/^' + date + '/gi')}).count()
const count = await UserInfoModel.find({registe_time: new RegExp(`^${date}`, 'gi')}).count()
res.send({
status: 1,
count,
Expand All @@ -103,7 +103,7 @@ class Statis {
return
}
try{
const count = await AdminModel.find({create_time: eval('/^' + date + '/gi')}).count()
const count = await AdminModel.find({create_time: new RegExp(`^${date}`, 'gi')}).count()
res.send({
status: 1,
count,
Expand All @@ -129,7 +129,7 @@ class Statis {
return
}
try{
const count = await OrderModel.find({formatted_created_at: eval('/^' + date + '/gi')}).count()
const count = await OrderModel.find({formatted_created_at: new RegExp(`^${date}`, 'gi')}).count()
res.send({
status: 1,
count,
Expand Down