From 55ee39dbadf5e75fe3a0513171ad2fd090979917 Mon Sep 17 00:00:00 2001 From: fomichev Date: Tue, 3 Dec 2024 14:33:33 +0300 Subject: [PATCH] =?utf8?q?=D0=A7=D0=B8=D1=81=D1=82=D0=BA=D0=B0=20=D0=BB?= =?utf8?q?=D0=B5=D0=B3=D0=B0=D1=81=D0=B8=20=D0=BA=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/ProductsController.php | 27 --------------------- erp24/web/js/products/products-1c.js | 31 +++--------------------- 2 files changed, 3 insertions(+), 55 deletions(-) diff --git a/erp24/controllers/ProductsController.php b/erp24/controllers/ProductsController.php index b7269e4d..ae01caab 100755 --- a/erp24/controllers/ProductsController.php +++ b/erp24/controllers/ProductsController.php @@ -276,36 +276,9 @@ class ProductsController extends Controller ->indexBy('product_id') ->column(); - $providers = ShipmentProviders::find() - ->select(['id', 'name']) - ->indexBy('id') - ->column(); - - $optionsData = Products1cOptions::find() - ->select(['id', 'colors']) - ->all(); - - $colorsProducts = []; - foreach ($optionsData as $option) { - $colorsProducts[$option->id] = explode(';', $option->colors); - } - - $varietiesData = ProductsVarieties::find() - ->select(['product_id', 'color', 'name']) - ->orderBy(['posit' => SORT_DESC]) - ->all(); - - $products_varieties = []; - foreach ($varietiesData as $variety) { - $products_varieties[$variety->product_id][$variety->color][] = $variety->name; - } - return $this->asJson([ 'data' => $data, 'prices' => $prices, - 'providers' => $providers, - 'colorsProducts' => $colorsProducts, - 'productsVarieties' => $products_varieties, 'parent_id' => $parent_id, ]); } diff --git a/erp24/web/js/products/products-1c.js b/erp24/web/js/products/products-1c.js index f917471e..f6214679 100644 --- a/erp24/web/js/products/products-1c.js +++ b/erp24/web/js/products/products-1c.js @@ -130,45 +130,20 @@ function ajax_products_in_group(parent_id){ return; } - const {data, prices, providers, colorsProducts, productsVarieties} = response; + const {data, prices} = response; let tableHtml = ''; data.forEach((row) => { const isHidden = row.view === 0 ? 'скрыто' : ''; - /*const providerButton = `
- + поставщика ${providers[row.id] ? providers[row.id] : ''}
`;*/ + const addCharButton = `
Доп. характеристики
`; - let colorsHtml = ''; - if (colorsProducts[row.id]) { - colorsProducts[row.id].forEach((color) => { - color = color.trim(); - if (color) { - colorsHtml += `${color}`; - if (productsVarieties[row.id] && productsVarieties[row.id][color]) { - productsVarieties[row.id][color].forEach((variety) => { - colorsHtml += `${variety}`; - }); - } - } - }); - - if (colorsHtml) { - colorsHtml += `+ добавить сорта`; - } - } - const price = `
+ const price = `
Цена: ${prices[row.id] || 'Нет цены'}
`; - const removeProductButtons = row.entity_id - ? `
удалить продукт
-
удалить только связь
` - : ''; - tableHtml += `
-- 2.39.5