delivery-content-mid-right
This commit is contained in:
parent
c3dffb2666
commit
595b3ecece
|
|
@ -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');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue