Fix LESS import error and refactor project structure
This commit is contained in:
@@ -6,9 +6,6 @@ use App\Core\Controller;
|
||||
use App\Models\Product;
|
||||
use App\Models\Category;
|
||||
|
||||
/**
|
||||
* ProductController - контроллер товаров и каталога
|
||||
*/
|
||||
class ProductController extends Controller
|
||||
{
|
||||
private Product $productModel;
|
||||
@@ -20,9 +17,6 @@ class ProductController extends Controller
|
||||
$this->categoryModel = new Category();
|
||||
}
|
||||
|
||||
/**
|
||||
* Каталог товаров
|
||||
*/
|
||||
public function catalog(): void
|
||||
{
|
||||
$this->requireAuth();
|
||||
@@ -30,7 +24,6 @@ class ProductController extends Controller
|
||||
$user = $this->getCurrentUser();
|
||||
$isAdmin = $this->isAdmin();
|
||||
|
||||
// Получаем параметры фильтрации
|
||||
$filters = [
|
||||
'category_id' => (int) $this->getQuery('category', 0),
|
||||
'search' => $this->getQuery('search', ''),
|
||||
@@ -42,7 +35,6 @@ class ProductController extends Controller
|
||||
|
||||
$showAll = $isAdmin && $this->getQuery('show_all') === '1';
|
||||
|
||||
// Получаем данные
|
||||
$categories = $this->categoryModel->getActive();
|
||||
$products = $showAll
|
||||
? $this->productModel->getAllForAdmin(true)
|
||||
@@ -51,7 +43,6 @@ class ProductController extends Controller
|
||||
$availableColors = $this->productModel->getAvailableColors();
|
||||
$availableMaterials = $this->productModel->getAvailableMaterials();
|
||||
|
||||
// Подкатегории для выбранной категории
|
||||
$subcategories = [];
|
||||
if ($filters['category_id'] > 0) {
|
||||
$subcategories = $this->categoryModel->getChildren($filters['category_id']);
|
||||
@@ -72,9 +63,6 @@ class ProductController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Страница товара
|
||||
*/
|
||||
public function show(int $id): void
|
||||
{
|
||||
$this->requireAuth();
|
||||
@@ -99,4 +87,3 @@ class ProductController extends Controller
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user