Skip to content

Commit

Permalink
fix random bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bahram1249 committed Jul 22, 2024
1 parent 790c89c commit 162f5d9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,12 @@ export class ProductQueryBuilderService {
`SELECT RAND(CHECKSUM(NEWID()))* count(*) as offset FROM ECProducts
WHERE inventoryStatusId = ${InventoryStatusEnum.available}
AND isnull(ECProducts.isDeleted, 0) = 0
AND ECProducts.publishStatusId = ${PublishStatusEnum.publish}`,
AND ECProducts.publishStatusId = ${PublishStatusEnum.publish}` +
filter.entityTypeId
? `AND ECProducts.entityTypeId = ${filter.entityTypeId}`
: '1=1 ' + (filter.brands.length > 0)
? `AND ECProducts.brandId IN (${filter.brands.toString()})`
: '1=1 ',
{ type: QueryTypes.SELECT, raw: true },
);

Expand Down

0 comments on commit 162f5d9

Please sign in to comment.