|
@@ -16,12 +16,20 @@ export class SupplyService extends BaseService<Supply> {
|
|
|
uModel: Repository<User>;
|
|
|
// 需求列表
|
|
|
async list(query) {
|
|
|
- const { skip = 0, limit = 0, is_use, status, ...condition } = pick(query, ['skip', 'limit', 'is_use', 'status']);
|
|
|
- const { one, two, thr, four } = pick(query, ['one', 'two', 'thr', 'four']);
|
|
|
+ // const { skip = 0, limit = 0, is_use, status, ...condition } = query;
|
|
|
+ const skip = get(query, 'skip', 0);
|
|
|
+ const limit = get(query, 'limit', 0);
|
|
|
+ const is_use = get(query, 'is_use');
|
|
|
+ const status = get(query, 'status');
|
|
|
+ // const { one, two, thr, four } = condition;
|
|
|
+ const one = get(query, 'one');
|
|
|
+ const two = get(query, 'two');
|
|
|
+ const thr = get(query, 'thr');
|
|
|
+ const four = get(query, 'four');
|
|
|
|
|
|
const whereObject: any = {};
|
|
|
- if (is_use) whereObject.is_show = Equal(is_use);
|
|
|
- if (status) whereObject.status = Equal(status);
|
|
|
+ // if (is_use) whereObject.is_use = Equal(is_use);
|
|
|
+ // if (status) whereObject.status = Equal(status);
|
|
|
if (one) whereObject.field = In(one);
|
|
|
if (two) whereObject.method = In(two);
|
|
|
if (thr) whereObject.area = In(thr);
|
|
@@ -29,7 +37,6 @@ export class SupplyService extends BaseService<Supply> {
|
|
|
const builder = this.model.createQueryBuilder().setFindOptions({ where: whereObject, skip, take: limit });
|
|
|
const data = await builder.getMany();
|
|
|
const total = await builder.getCount();
|
|
|
-
|
|
|
// const info: any = { is_use, status };
|
|
|
// if (one) info.field = { $in: one };
|
|
|
// if (two) info.method = { $in: two };
|