|
@@ -3,7 +3,6 @@ const { CrudService } = require('naf-framework-mongoose-free/lib/service');
|
|
|
const { BusinessError, ErrorCode } = require('naf-core').Error;
|
|
|
const _ = require('lodash');
|
|
|
const assert = require('assert');
|
|
|
-const { pipeline } = require('stream');
|
|
|
|
|
|
// 店铺类视图
|
|
|
class ShopService extends CrudService {
|
|
@@ -14,19 +13,6 @@ class ShopService extends CrudService {
|
|
|
|
|
|
// 微店页面查询
|
|
|
async microIndex(condition, options) {
|
|
|
- // const pipline = [{ $sort: { 'meta.createdAt': -1 } }];
|
|
|
- // pipline.push({ $project: { name: 1, file: 1 } });
|
|
|
- // pipline.push({ $addFields: { shop_id: { $toString: '$_id' } } });
|
|
|
- // // 表关联
|
|
|
- // pipline.push({
|
|
|
- // $lookup: {
|
|
|
- // from: 'goods',
|
|
|
- // localField: 'shop_id',
|
|
|
- // foreignField: 'shop',
|
|
|
- // as: 'goods',
|
|
|
- // },
|
|
|
- // });
|
|
|
- // const list = await this.model.aggregate(pipline);
|
|
|
let list = await this.ctx.service.shop.shop.query(condition, { ...options, projection: [ 'name', 'logo' ] });
|
|
|
list = JSON.parse(JSON.stringify(list));
|
|
|
const arr = [];
|