attribute color product filter

This commit is contained in:
merdan 2022-05-19 14:26:55 +05:00
parent dd93b40922
commit 35b78e32f2
1 changed files with 2 additions and 0 deletions

View File

@ -9,6 +9,7 @@ use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Webkul\Attribute\Models\Attribute;
@ -344,6 +345,7 @@ class ProductRepository extends Repository
# apply scope query so we can fetch the raw sql and perform a count
$repository->applyScope();
$countQuery = "select count(*) as aggregate from ({$repository->model->toSql()}) c";
Log::info($repository->model->toSql());
$count = collect(DB::select($countQuery, $repository->model->getBindings()))->pluck('aggregate')->first();
if ($count > 0) {