Compare commits
2 Commits
f365bff782
...
c23d0eeab0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c23d0eeab0 | ||
|
|
14b47d40e8 |
@@ -46,7 +46,7 @@ class FilterController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->shouldFilterByCollection()) {
|
if ($this->shouldFilterByCollection()) {
|
||||||
return $this->categoriesFor();
|
return $this->categoriesFor($this->request->collection_id, 'collection');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->shouldFilterByBrand()) {
|
if ($this->shouldFilterByBrand()) {
|
||||||
@@ -54,7 +54,7 @@ class FilterController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->shouldFilterByChannel()) {
|
if ($this->shouldFilterByChannel()) {
|
||||||
return $this->filterByCategoryResource(Channel::find($this->request->channel_id));
|
return $this->filterByCategoryResource($this->request->channel_id, 'category');
|
||||||
}
|
}
|
||||||
|
|
||||||
return Category::query()->where('is_visible', true)->ordered()->get(['id', 'parent_id', 'name']);
|
return Category::query()->where('is_visible', true)->ordered()->get(['id', 'parent_id', 'name']);
|
||||||
@@ -115,20 +115,20 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Categories for a resource
|
* Categories for a resource
|
||||||
*/
|
*/
|
||||||
private function categoriesFor($resource)
|
private function categoriesFor(int $id, string $type)
|
||||||
{
|
{
|
||||||
return DB::table('categories as c')
|
return DB::table('categories as c')
|
||||||
->select('c.id', 'c.parent_id', 'c.name')
|
->select('c.id', 'c.parent_id', 'c.name')
|
||||||
->where('c.is_visible', true)
|
->where('c.is_visible', true)
|
||||||
->whereExists(function ($query) {
|
->whereExists(function ($query) use ($id, $type) {
|
||||||
$query->select(DB::raw(1))
|
$query->select(DB::raw(1))
|
||||||
->from('product_has_relations as phr_cat')
|
->from('product_has_relations as phr_cat')
|
||||||
->join('products as p', 'p.id', '=', 'phr_cat.product_id')
|
->join('products as p', 'p.id', '=', 'phr_cat.product_id')
|
||||||
->join('product_has_relations as phr_chan', 'phr_chan.product_id', '=', 'p.id')
|
->join('product_has_relations as phr_chan', 'phr_chan.product_id', '=', 'p.id')
|
||||||
->whereColumn('phr_cat.productable_id', 'c.id')
|
->whereColumn('phr_cat.productable_id', 'c.id')
|
||||||
->where('phr_cat.productable_type', 'category')
|
->where('phr_cat.productable_type', 'category')
|
||||||
->where('phr_chan.productable_type', 'channel')
|
->where('phr_chan.productable_type', $type)
|
||||||
->where('phr_chan.productable_id', 6)
|
->where('phr_chan.productable_id', $id)
|
||||||
->where('p.is_visible', true)
|
->where('p.is_visible', true)
|
||||||
->whereNull('p.parent_id')
|
->whereNull('p.parent_id')
|
||||||
->where('p.stock', '>', 0);
|
->where('p.stock', '>', 0);
|
||||||
|
|||||||
46
composer.lock
generated
46
composer.lock
generated
@@ -3307,31 +3307,31 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "maennchen/zipstream-php",
|
"name": "maennchen/zipstream-php",
|
||||||
"version": "3.2.2",
|
"version": "3.1.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/maennchen/ZipStream-PHP.git",
|
"url": "https://github.com/maennchen/ZipStream-PHP.git",
|
||||||
"reference": "77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e"
|
"reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e",
|
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/aeadcf5c412332eb426c0f9b4485f6accba2a99f",
|
||||||
"reference": "77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e",
|
"reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-zlib": "*",
|
"ext-zlib": "*",
|
||||||
"php-64bit": "^8.3"
|
"php-64bit": "^8.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"brianium/paratest": "^7.7",
|
"brianium/paratest": "^7.7",
|
||||||
"ext-zip": "*",
|
"ext-zip": "*",
|
||||||
"friendsofphp/php-cs-fixer": "^3.86",
|
"friendsofphp/php-cs-fixer": "^3.16",
|
||||||
"guzzlehttp/guzzle": "^7.5",
|
"guzzlehttp/guzzle": "^7.5",
|
||||||
"mikey179/vfsstream": "^1.6",
|
"mikey179/vfsstream": "^1.6",
|
||||||
"php-coveralls/php-coveralls": "^2.5",
|
"php-coveralls/php-coveralls": "^2.5",
|
||||||
"phpunit/phpunit": "^12.0",
|
"phpunit/phpunit": "^11.0",
|
||||||
"vimeo/psalm": "^6.0"
|
"vimeo/psalm": "^6.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
@@ -3373,7 +3373,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
|
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
|
||||||
"source": "https://github.com/maennchen/ZipStream-PHP/tree/3.2.2"
|
"source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -3381,7 +3381,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2026-04-11T18:38:28+00:00"
|
"time": "2025-01-27T12:07:53+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "markbaker/complex",
|
"name": "markbaker/complex",
|
||||||
@@ -4359,16 +4359,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "openspout/openspout",
|
"name": "openspout/openspout",
|
||||||
"version": "v4.32.0",
|
"version": "v4.28.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/openspout/openspout.git",
|
"url": "https://github.com/openspout/openspout.git",
|
||||||
"reference": "41f045c1f632e1474e15d4c7bc3abcb4a153563d"
|
"reference": "ab05a09fe6fce57c90338f83280648a9786ce36b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/openspout/openspout/zipball/41f045c1f632e1474e15d4c7bc3abcb4a153563d",
|
"url": "https://api.github.com/repos/openspout/openspout/zipball/ab05a09fe6fce57c90338f83280648a9786ce36b",
|
||||||
"reference": "41f045c1f632e1474e15d4c7bc3abcb4a153563d",
|
"reference": "ab05a09fe6fce57c90338f83280648a9786ce36b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -4378,17 +4378,17 @@
|
|||||||
"ext-libxml": "*",
|
"ext-libxml": "*",
|
||||||
"ext-xmlreader": "*",
|
"ext-xmlreader": "*",
|
||||||
"ext-zip": "*",
|
"ext-zip": "*",
|
||||||
"php": "~8.3.0 || ~8.4.0 || ~8.5.0"
|
"php": "~8.2.0 || ~8.3.0 || ~8.4.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"ext-zlib": "*",
|
"ext-zlib": "*",
|
||||||
"friendsofphp/php-cs-fixer": "^3.86.0",
|
"friendsofphp/php-cs-fixer": "^3.68.3",
|
||||||
"infection/infection": "^0.31.2",
|
"infection/infection": "^0.29.10",
|
||||||
"phpbench/phpbench": "^1.4.1",
|
"phpbench/phpbench": "^1.4.0",
|
||||||
"phpstan/phpstan": "^2.1.22",
|
"phpstan/phpstan": "^2.1.2",
|
||||||
"phpstan/phpstan-phpunit": "^2.0.7",
|
"phpstan/phpstan-phpunit": "^2.0.4",
|
||||||
"phpstan/phpstan-strict-rules": "^2.0.6",
|
"phpstan/phpstan-strict-rules": "^2",
|
||||||
"phpunit/phpunit": "^12.3.7"
|
"phpunit/phpunit": "^11.5.4"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-iconv": "To handle non UTF-8 CSV files (if \"php-mbstring\" is not already installed or is too limited)",
|
"ext-iconv": "To handle non UTF-8 CSV files (if \"php-mbstring\" is not already installed or is too limited)",
|
||||||
@@ -4436,7 +4436,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/openspout/openspout/issues",
|
"issues": "https://github.com/openspout/openspout/issues",
|
||||||
"source": "https://github.com/openspout/openspout/tree/v4.32.0"
|
"source": "https://github.com/openspout/openspout/tree/v4.28.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -4448,7 +4448,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-09-03T16:03:54+00:00"
|
"time": "2025-01-30T13:51:11+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "outl1ne/nova-multiselect-field",
|
"name": "outl1ne/nova-multiselect-field",
|
||||||
|
|||||||
Reference in New Issue
Block a user