From: Alexander Smirnov
Date: Thu, 25 Jan 2024 08:34:15 +0000 (+0300)
Subject: replace pdo with ar in store-polnogram-logi
X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=89cea8e90b055226171a59cde18721fe5ac5521f;p=yii-erp24%2F.git
replace pdo with ar in store-polnogram-logi
---
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'| ÑейÑÐ°Ñ | '.$dataRow["quantity"].' | '.$dataRow["quantity_max"].' | '.$dataRow["color"].' |
';
- $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) {