|
@@ -151,7 +151,7 @@ class GoodsService extends CrudService {
|
|
async indexGoodsList(condition, { skip = 0, limit = 20 } = {}) {
|
|
async indexGoodsList(condition, { skip = 0, limit = 20 } = {}) {
|
|
condition = this.dealFilter(condition);
|
|
condition = this.dealFilter(condition);
|
|
const pipeline = [{ $match: { status: { $ne: '0' } } }]; // { $sort: { sort: 1 } },
|
|
const pipeline = [{ $match: { status: { $ne: '0' } } }]; // { $sort: { sort: 1 } },
|
|
- const { view_num, sell_num, sell_money, name, shop, tags } = condition;
|
|
|
|
|
|
+ const { view_num, sell_num, sell_money, name, shop, tags, act_tags } = condition;
|
|
let sort = {};
|
|
let sort = {};
|
|
if (view_num) sort.view_num = parseInt(view_num);
|
|
if (view_num) sort.view_num = parseInt(view_num);
|
|
if (sell_num) sort.sell_num = parseInt(sell_num);
|
|
if (sell_num) sort.sell_num = parseInt(sell_num);
|
|
@@ -159,6 +159,7 @@ class GoodsService extends CrudService {
|
|
if (name) pipeline.push({ $match: { name: new RegExp(name) } });
|
|
if (name) pipeline.push({ $match: { name: new RegExp(name) } });
|
|
if (shop) pipeline.push({ $match: { shop } });
|
|
if (shop) pipeline.push({ $match: { shop } });
|
|
if (tags) pipeline.push({ $match: { tags: { $elemMatch: { $elemMatch: { $eq: tags } } } } });
|
|
if (tags) pipeline.push({ $match: { tags: { $elemMatch: { $elemMatch: { $eq: tags } } } } });
|
|
|
|
+ if (act_tags) pipeline.push({ $match: { act_tags: { $elemMatch: { $eq: act_tags } } } });
|
|
pipeline.push({
|
|
pipeline.push({
|
|
$lookup: {
|
|
$lookup: {
|
|
from: 'actTags',
|
|
from: 'actTags',
|