|
@@ -38,7 +38,7 @@ class StoreShopService extends CrudService {
|
|
|
const searchPips = { };
|
|
|
const sort = { time: -1 };
|
|
|
if (name) searchPips.name = new RegExp(name);
|
|
|
- if (time) sort.time = time;
|
|
|
+ if (time) sort.time = parseInt(time) || -1;
|
|
|
|
|
|
const pipline = [{ $match: { customer } }];
|
|
|
// 关联店铺
|
|
@@ -69,6 +69,8 @@ class StoreShopService extends CrudService {
|
|
|
// 联表-规格
|
|
|
const qPipline = _.cloneDeep(pipline);
|
|
|
qPipline.push({ $sort: sort });
|
|
|
+ if (parseInt(skip)) qPipline.push({ $skip: parseInt(skip) });
|
|
|
+ if (parseInt(limit)) qPipline.push({ $limit: parseInt(limit) });
|
|
|
const list = await this.model.aggregate(qPipline);
|
|
|
const tPipline = _.cloneDeep(pipline);
|
|
|
tPipline.push({ $count: 'total' });
|