feat: filter date
This commit is contained in:
parent
ffa8095dcc
commit
b36b6f9f07
1 changed files with 9 additions and 0 deletions
|
|
@ -154,6 +154,7 @@ export class StatsController extends Controller {
|
||||||
by: "productId",
|
by: "productId",
|
||||||
where: {
|
where: {
|
||||||
quotation: {
|
quotation: {
|
||||||
|
createdAt: { gte: startDate, lte: endDate },
|
||||||
registeredBranch: { OR: permissionCondCompany(req.user) },
|
registeredBranch: { OR: permissionCondCompany(req.user) },
|
||||||
},
|
},
|
||||||
productId: { in: record.map((v) => v.id) },
|
productId: { in: record.map((v) => v.id) },
|
||||||
|
|
@ -187,4 +188,12 @@ export class StatsController extends Controller {
|
||||||
updatedAt: v.updatedAt,
|
updatedAt: v.updatedAt,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("sale")
|
||||||
|
async saleReport(
|
||||||
|
@Request() req: RequestWithUser,
|
||||||
|
@Query() limit?: number,
|
||||||
|
@Query() startDate?: Date,
|
||||||
|
@Query() endDate?: Date,
|
||||||
|
) {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue