cache responces achyklar

This commit is contained in:
merdan 2022-12-21 19:52:14 +05:00
parent 35f2ebc761
commit 8350f5468d
1 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@
namespace Sarga\API\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Sarga\API\Http\Resources\Catalog\Brand;
use Sarga\Brand\Repositories\BrandRepository;
@ -54,11 +55,12 @@ class Brands extends \Webkul\RestApi\Http\Controllers\V1\Shop\ResourceController
}
$query->whereHas('flats', function($q){
$q->where('status',1);
$q->where('product_flat.status',1);
if(request()->has('category'))
{
$q->whereIn('product_id',function ($q) {
Log::info(request());
$q->whereIn('product_flat.product_id',function ($q) {
$q->select('product_categories.product_id')->from('product_categories')
->where('product_categories.category_id',request()->get('category'));
});