|
@@ -33,7 +33,6 @@ class GoodsJoinActService extends CrudService {
|
|
|
}
|
|
|
|
|
|
async query(filter, { skip = 0, limit, sort, desc, projection } = {}) {
|
|
|
- console.log(filter);
|
|
|
const { platform_act, platform_act_type, shop, shop_name, goods, goods_name, spec, spec_name, status } = filter;
|
|
|
const mq = {};
|
|
|
if (platform_act) mq.platform_act = platform_act;
|
|
@@ -61,6 +60,7 @@ class GoodsJoinActService extends CrudService {
|
|
|
});
|
|
|
pipeline.push({
|
|
|
$project: {
|
|
|
+ meta: 1,
|
|
|
shop: 1,
|
|
|
shop_name: { $first: '$shopInfo.name' },
|
|
|
goods: '$goods._id',
|
|
@@ -75,6 +75,7 @@ class GoodsJoinActService extends CrudService {
|
|
|
},
|
|
|
});
|
|
|
const qPipeline = _.cloneDeep(pipeline);
|
|
|
+ qPipeline.push({ $sort: { 'meta.createdAt': -1 } });
|
|
|
if (parseInt(skip)) qPipeline.push({ $skip: parseInt(skip) });
|
|
|
if (parseInt(limit)) qPipeline.push({ $limit: parseInt(limit) });
|
|
|
const res = await this.model.aggregate(qPipeline);
|