feat: enhance loginQueue method to filter orders by date range
parent
baeb72fe7d
commit
fdbd667b7d
|
@ -40,11 +40,14 @@ export class TicketDataService extends BaseDataService<QueueTicket> {
|
||||||
}
|
}
|
||||||
|
|
||||||
async loginQueue(id: string): Promise<QueueOrder> {
|
async loginQueue(id: string): Promise<QueueOrder> {
|
||||||
|
const start = moment().startOf('day').valueOf();
|
||||||
|
const end = moment().endOf('day').valueOf();
|
||||||
|
|
||||||
const order = await this.order.findOne({
|
const order = await this.order.findOne({
|
||||||
relations: ['tickets'],
|
relations: ['tickets'],
|
||||||
where: [
|
where: [
|
||||||
{ transaction_id: id },
|
{ transaction_id: id, date: Between(start, end) },
|
||||||
{ code: id, transaction_id: Not(IsNull()) },
|
{ code: id, transaction_id: Not(IsNull()), date: Between(start, end) },
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue