delivery-content-mid-right

This commit is contained in:
merdan 2023-03-27 13:39:30 +05:00
parent c3dffb2666
commit 595b3ecece
3 changed files with 9 additions and 7 deletions

View File

@ -55,12 +55,12 @@ class FilterOptions extends \Webkul\RestApi\Http\Controllers\V1\Shop\ResourceCon
});
}
if(request()->has('brand')){
$q->whereIn('product_attribute_values.product_id',function ($q) {
$q->select('products.id')->from('products')
->where('products.brand_id',request()->get('brand'));
});
}
// if(request()->has('brand')){
// $q->whereIn('product_attribute_values.product_id',function ($q) {
// $q->select('products.id')->from('products')
// ->where('products.brand_id',request()->get('brand'));
// });
// }
$q->groupBy('integer_value');
});

View File

@ -18,7 +18,7 @@ class Attribute extends JsonResource
'id' => $this->id,
'code' => $this->code,
'name' => $this->name ?? $this->admin_name,
'options' => AttributeOption::collection($this->options),
// 'options' => AttributeOption::collection($this->options),
];
}

View File

@ -7,6 +7,7 @@ use TPS\API\Http\Controllers\CMS;
use TPS\API\Http\Controllers\Customers;
use TPS\API\Http\Controllers\Categories;
use TPS\API\Http\Controllers\Channels;
use TPS\API\Http\Controllers\FilterOptions;
use TPS\API\Http\Controllers\Orders;
use TPS\API\Http\Controllers\Products;
use TPS\API\Http\Controllers\Reviews;
@ -29,6 +30,7 @@ Route::group(['prefix' => 'api','middleware' => ['locale', 'currency']], functio
Route::get('descendant-categories', [Categories::class, 'index'])->name('descendant-categories');
Route::get('category-brands/{id}', [Categories::class, 'brands']);
Route::get('categories/{id}/filters',[Categories::class,'filters']);
Route::get('attribute-options', [FilterOptions::class, 'allResources']);
/**
* Product routes.
*/