|
@@ -35,9 +35,9 @@ class StoreShopService extends CrudService {
|
|
|
const customer = _.get(this.ctx, 'user._id');
|
|
|
assert(customer, '缺少用户信息');
|
|
|
const { name, time } = query;
|
|
|
- const searchPips = { };
|
|
|
+ const searchPips = [];
|
|
|
const sort = { time: -1 };
|
|
|
- if (name) searchPips.name = new RegExp(name);
|
|
|
+ if (name) searchPips.push({ $match: { name: new RegExp(name) } });
|
|
|
if (time) sort.time = parseInt(time) || -1;
|
|
|
|
|
|
const pipline = [{ $match: { customer } }];
|