|
@@ -19,27 +19,11 @@ export class CompanyService extends BaseService<modelType> {
|
|
|
const { skip = 0, limit = 0, is_show, status, ...condition } = query;
|
|
|
const { one, two, thr, four, five } = condition;
|
|
|
const info: any = { is_show, status };
|
|
|
-
|
|
|
- if (one) {
|
|
|
- if (!Array.isArray(one)) info.scale = one;
|
|
|
- else info.scale = { $all: one };
|
|
|
- }
|
|
|
- if (two) {
|
|
|
- if (!Array.isArray(two)) info.pattern = two;
|
|
|
- else info.pattern = { $all: two };
|
|
|
- }
|
|
|
- if (thr) {
|
|
|
- if (!Array.isArray(thr)) info.area = thr;
|
|
|
- else info.area = { $all: thr };
|
|
|
- }
|
|
|
- if (four) {
|
|
|
- if (!Array.isArray(four)) info.type = four;
|
|
|
- else info.type = { $all: four };
|
|
|
- }
|
|
|
- if (five) {
|
|
|
- if (!Array.isArray(five)) info.companyStatus = five;
|
|
|
- else info.companyStatus = { $all: five };
|
|
|
- }
|
|
|
+ if (one) info.scale = { $in: one };
|
|
|
+ if (two) info.pattern = { $in: two };
|
|
|
+ if (thr) info.area = { $in: thr };
|
|
|
+ if (four) info.type = { $in: four };
|
|
|
+ if (five) info.companyStatus = { $in: five };
|
|
|
const data = await this.model.find(info).skip(skip).limit(limit).lean();
|
|
|
const total = await this.model.count(info);
|
|
|
return { data, total };
|