|
@@ -234,8 +234,10 @@ class OrderDetailService extends CrudService {
|
|
|
let condition = _.cloneDeep(filter);
|
|
|
condition = await this.beforeQuery(condition);
|
|
|
condition = this.dealFilter(condition);
|
|
|
- const pipline = [{ $project: { _id: 1, id: { $toString: '$_id' } } }, { $sort: { 'meta.createdAt': -1 } }];
|
|
|
+ console.log(condition);
|
|
|
+ const pipline = [{ $sort: { 'meta.createdAt': -1 } }];
|
|
|
pipline.push({ $match: condition });
|
|
|
+ pipline.push({ $project: { _id: 1, id: { $toString: '$_id' } } });
|
|
|
pipline.push({ $count: 'id' });
|
|
|
const rs = await this.model.aggregate(pipline);
|
|
|
return _.get(_.head(rs), 'id');
|