Skip to content

Commit

Permalink
fix bug of query of discounts
Browse files Browse the repository at this point in the history
  • Loading branch information
bahram1249 committed May 20, 2024
1 parent c866512 commit caf9501
Showing 1 changed file with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,25 @@ export class ProductDiscountSetterService {
},
])
.filter(
Sequelize.where(
Sequelize.fn(
'dateadd',
Sequelize.literal('minute'),
Sequelize.literal('10'),
Sequelize.where(Sequelize.fn('getdate'), {
[Op.between]: [
Sequelize.fn(
'isnull',
Sequelize.col('ECDiscount.endDate'),
Sequelize.col('ECDiscount.startDate'),
Sequelize.fn('getdate'),
),
),
{
[Op.gte]: Sequelize.fn('getdate'),
},
),
Sequelize.fn(
'dateadd',
Sequelize.literal('day'),
Sequelize.literal('1'),
Sequelize.fn(
'isnull',
Sequelize.col('ECDiscount.endDate'),
Sequelize.fn('getdate'),
),
),
],
}),
)
.filter(
Sequelize.where(
Expand Down

0 comments on commit caf9501

Please sign in to comment.