]> gitweb.erp-flowers.ru Git - yii-erp24/.git/commitdiff
replace pdo with ar in store-polnogram-logi
authorAlexander Smirnov <fredeom@mail.ru>
Thu, 25 Jan 2024 08:34:15 +0000 (11:34 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Thu, 25 Jan 2024 08:34:15 +0000 (11:34 +0300)
erp24/views/shipment/store-planogram-logi.php

index 230e9e67848ab1e5e1b989429f799ff9952e2281..64883af7af2bfc39190dc8aebe8388140aadb727 100644 (file)
@@ -1,5 +1,10 @@
 <?php
 
+use yii_app\records\Products1c;
+use yii\helpers\ArrayHelper;
+use yii_app\records\StorePlanogram;
+use yii_app\records\StorePlanogramLogi;
+
 include_once(dirname(__DIR__, 2) . "/startup.php");
 include_once(dirname(__DIR__, 2) . "/inc/db.php");
 include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
@@ -20,8 +25,9 @@ echo'<h1 class="page-title mb-0 text-primary">Логи матрицы товар
 
 </p><div id=editDiv></div>';
 
-
-$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)) {
 <table class="table">';
     echo'<tbody>';
 
-
-    $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'<tr><td>сейчас</td><td>'.$dataRow["quantity"].'</td><td>'.$dataRow["quantity_max"].'</td><td>'.$dataRow["color"].'</td></tr>';
 
 
-    $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) {