|
@@ -22,11 +22,21 @@ export class OrderDetailService extends BaseService<modelType> {
|
|
|
userModel: ReturnModelType<typeof User>;
|
|
|
|
|
|
async queryInfo(filter): Promise<object> {
|
|
|
- const { skip = 0, limit, leader, accounting, ...info } = filter;
|
|
|
+ const { skip = 0, limit, leader, accounting, goods, ...info } = filter;
|
|
|
let list: any = [];
|
|
|
let total: any = 0;
|
|
|
if (leader) info.leader = { $in: [leader] };
|
|
|
else if (accounting) info.accounting = { $in: [accounting] };
|
|
|
+ if (goods) {
|
|
|
+ const arr = await this.goodModel
|
|
|
+ .findOne({
|
|
|
+ name: {
|
|
|
+ $regex: goods,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .lean();
|
|
|
+ if (arr) info.good = arr._id;
|
|
|
+ }
|
|
|
list = await this.model.find(info).skip(skip).limit(limit).lean();
|
|
|
total = await this.model.count(info);
|
|
|
for (const val of list) {
|