invert query from offers->articles to articles->offers

This commit is contained in:
Ludovic CANDELLIER
2022-01-05 22:05:30 +01:00
parent 8a1573d425
commit b2f5cc4a45
17 changed files with 121 additions and 93 deletions

View File

@@ -6,11 +6,6 @@ use App\Repositories\Core\Arrays;
class Categories
{
public static function getTree($withFolder = false)
{
$categories = self::getCategoryTree()->toArray();
return self::getChildren($categories[0]['children'], $withFolder);
}
public static function getFancyTree()
{
@@ -20,6 +15,12 @@ class Categories
return $categories;
}
public static function getTree($withFolder = false)
{
$categories = self::getCategoryTree()->toArray();
return self::getChildren($categories[0]['children'], $withFolder);
}
public static function getCategoryTree()
{
return self::getModel()->defaultOrder()->get()->toTree();