From 89cea8e90b055226171a59cde18721fe5ac5521f Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Thu, 25 Jan 2024 11:34:15 +0300 Subject: [PATCH] replace pdo with ar in store-polnogram-logi --- erp24/views/shipment/store-planogram-logi.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/erp24/views/shipment/store-planogram-logi.php b/erp24/views/shipment/store-planogram-logi.php index 230e9e6..64883af 100644 --- a/erp24/views/shipment/store-planogram-logi.php +++ b/erp24/views/shipment/store-planogram-logi.php @@ -1,5 +1,10 @@ Логи матрицы товар

'; - -$storesAll=$db::mapping("SELECT name,id FROM products_1c WHERE tip='city_store' order by name ASC"); +$storesAll = ArrayHelper::map(Products1c::find()->select(['name', 'id'])->where(['tip' => 'city_store']) + ->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'); +//$storesAll=$db::mapping("SELECT name,id FROM products_1c WHERE tip='city_store' order by name ASC"); @@ -33,14 +39,16 @@ if(!empty($store_id)) { '; echo''; - - $dataRow=$db::getRow("SELECT * FROM store_planogram WHERE store_id=? AND product_id=? AND color=''",[$store_id,$product_id]); + $dataRow = StorePlanogram::find()->where(['store_id' => $store_id, 'product_id' => $product_id, 'color' => ''])->one(); +// $dataRow=$db::getRow("SELECT * FROM store_planogram WHERE store_id=? AND product_id=? AND color=''",[$store_id,$product_id]); echo''; - $data=$db::getRows("SELECT * FROM store_planogram_logi WHERE store_id=? AND product_id=? order by date_id DESC, color ASC",[$store_id,$product_id]); + $data = StorePlanogramLogi::find()->where(['store_id' => $store_id, 'product_id' => $product_id]) + ->orderBy(['date_id' => SORT_DESC, 'color' => SORT_ASC])->asArray()->all(); +// $data=$db::getRows("SELECT * FROM store_planogram_logi WHERE store_id=? AND product_id=? order by date_id DESC, color ASC",[$store_id,$product_id]); foreach($data as $row) { -- 2.39.5
сейчас'.$dataRow["quantity"].''.$dataRow["quantity_max"].''.$dataRow["color"].'