discounted configurables
This commit is contained in:
parent
15e5c76f6a
commit
40ba2c8e77
|
|
@ -426,7 +426,6 @@ class ProductRepository extends WProductRepository
|
|||
});
|
||||
|
||||
# apply scope query so we can fetch the raw sql and perform a count
|
||||
$repository->applyScope();
|
||||
# sort direction
|
||||
$orderDirection = 'asc';
|
||||
if (isset($params['order']) && in_array($params['order'], ['desc', 'asc'])) {
|
||||
|
|
@ -446,6 +445,9 @@ class ProductRepository extends WProductRepository
|
|||
}
|
||||
}
|
||||
|
||||
$repository->applyScope();
|
||||
|
||||
|
||||
$countQuery = "select count(*) as aggregate from ({$repository->model->toSql()}) c";
|
||||
$count = collect(DB::select($countQuery, $repository->model->getBindings()))->pluck('aggregate')->first();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue