]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ошибка
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 18 Dec 2025 14:40:42 +0000 (17:40 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 18 Dec 2025 14:40:42 +0000 (17:40 +0300)
erp24/controllers/MarketplaceOrdersController.php
erp24/views/marketplace-orders/index.php
erp24/views/marketplace-orders/view.php

index 3f7e60b78ba22284838fd4f2b9bb25dea74845b4..e3d7a38c880d52ee3456e659b0ae9cebdd4ceb43 100644 (file)
@@ -66,8 +66,8 @@ class MarketplaceOrdersController extends Controller
         $searchModel = new MarketplaceOrdersSearch();
         $dataProvider = $searchModel->search($this->request->queryParams);
 
-        // Добавляем eager loading для items для проверки готовности к отправке в 1С
-        $dataProvider->query->with('items');
+        // Добавляем eager loading для items, store, mpstore для проверки готовности к отправке в 1С и отображения
+        $dataProvider->query->with(['items', 'store', 'mpstore']);
 
         $dataProvider->sort->defaultOrder = [
             'creation_date' => SORT_DESC,
@@ -950,6 +950,8 @@ class MarketplaceOrdersController extends Controller
             ->with([
                 'status1C',
                 'items',
+                'store',
+                'mpstore',
             ])
             ->where(['id' => $id])
             ->one();
index 9f46660109ffc2ab2cfe8dddb7f497d67aa4fe68..b00baff81eda2083fc8cf5b36f835e050a91f689 100644 (file)
@@ -86,7 +86,7 @@ YiiAsset::register($this);
                 'attribute' => 'store_id',
                 'format' => 'raw', // добавляем raw формат
                 'value' => function ($model) {
-                    $storeName = $model->store->name ?? '-';
+                    $storeName = $model->store ? $model->store->name : '-';
                     $warehouseId = $model->mpstore ? MarketplaceStore::getWarehouseId()[$model->mpstore->warehouse_id] ?? '-' : '-';
                     $warehouseGuid = $model->warehouse_guid ?? '-';
                     
index f2458eacc3aeb77a5d92657390cc96dc8193c4e0..061bd02ba95a73ac0585cdeb8b6100c47c589a37 100644 (file)
@@ -12,7 +12,7 @@ use yii\web\View;
 $this->registerCssFile('@web/css/fancybox.css');
 $this->registerJsFile('@web/js/fancybox.umd.js', ['position' => View::POS_END]);
 $this->registerJsFile('/js/bouquet/bouquet.js', ['position' => View::POS_END]);
-$this->title = 'Заказ магазина ' . $model->store->name . ' от ' . $model->creation_date;
+$this->title = 'Заказ магазина ' . ($model->store ? $model->store->name : 'Unknown') . ' от ' . $model->creation_date;
 $this->params['breadcrumbs'][] = ['label' => 'Marketplace Orders', 'url' => ['index']];
 $this->params['breadcrumbs'][] = $this->title;
 \yii\web\YiiAsset::register($this);
@@ -43,7 +43,7 @@ $this->params['breadcrumbs'][] = $this->title;
             [
                 'attribute' => 'store_id',
                 'value' => function ($model) {
-                    return $model->store->name;
+                    return $model->store ? $model->store->name : '-';
                 }
             ],
             [