Skip to content

Commit

Permalink
fix random
Browse files Browse the repository at this point in the history
  • Loading branch information
bahram1249 committed Jul 22, 2024
1 parent 7d47b5c commit 11110cb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,10 @@ export class ProductQueryBuilderService {
{ type: QueryTypes.SELECT, raw: true },
);

const offset = Math.round(offsetRandom[0]['offset']);
let offset = Math.round(offsetRandom[0]['offset']) - filter.limit;
if (offset < 0) {
offset = 0;
}
queryBuilder = queryBuilder
.offset(offset)
.filter({ inventoryStatusId: InventoryStatusEnum.available });
Expand Down

0 comments on commit 11110cb

Please sign in to comment.