]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Фильтруем только заказы с заполненным status_processing_1C origin/feature_fomichev_erp-20251010_fix_status_id
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Mon, 13 Oct 2025 09:24:06 +0000 (12:24 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Mon, 13 Oct 2025 09:24:06 +0000 (12:24 +0300)
erp24/api2/controllers/OrdersController.php
erp24/controllers/MarketplaceOrdersController.php
erp24/records/MarketplaceOrdersSearch.php
erp24/views/marketplace-orders/index.php
erp24/views/marketplace-orders/view.php

index ddd97971a44ad8943f555762271ea4441d497bd4..355673b3059cde119ba156d13f22b14b33670070 100644 (file)
@@ -244,7 +244,7 @@ class OrdersController extends BaseController
                 ->with('items')
                 ->with('status1C')
                 ->where(['store_id' => $storeId])
-                ->andWhere(['status_1c' => MarketplaceOrders::STATUSES_1C_CREATED_IN_1C])
+                ->andWhere(['IS NOT', 'status_processing_1c', null])
                 ->andWhere(['>=', 'creation_date', $startTime->format('Y-m-d H:i:s')])
                 ->andWhere(['<=', 'creation_date', $currentTime->format('Y-m-d H:i:s')])
                 ->orderBy(['id' => SORT_DESC])
index 3bbf07f87c0187d165cc789a1bcd0bfc360ac297..10ca79aded981d0973b134340762c25b6ccd8c09 100644 (file)
@@ -908,7 +908,15 @@ class MarketplaceOrdersController extends Controller
      */
     protected function findModel($id)
     {
-        if (($model = MarketplaceOrders::findOne(['id' => $id])) !== null) {
+        $model = MarketplaceOrders::find()
+            ->with([
+                'status1C',
+                'items',
+            ])
+            ->where(['id' => $id])
+            ->one();
+
+        if ($model !== null) {
             return $model;
         }
 
index 1bd1a2a8763bce0dc1720c7753b0cf7446731a05..6b4074602423395c2334ba2d67bfd825d4b44177 100644 (file)
@@ -60,6 +60,7 @@ class MarketplaceOrdersSearch extends MarketplaceOrders
     public function search($params, $formName = null)
     {
         $query = MarketplaceOrders::find()
+            ->with('status1C')
             ->joinWith(['store', 'status statusAlias', 'substatus substatusAlias']);
 
         $dataProvider = new ActiveDataProvider([
index 5eaf7bf9cc01756d2430ab81c940dc4f7cf1175d..22c02cae7f727a3b2250e9329e18c7a5995a4e34 100644 (file)
@@ -175,7 +175,7 @@ YiiAsset::register($this);
             [
                 'attribute' => 'status_processing_1c',
                 'value' => function ($model) {
-                    return $model->status1c->status ?? null;
+                    return $model->status1C->status ?? null;
                 }
             ],
             [
index be021aea1c8409d92789e4e88f37896dcd17f50c..f2458eacc3aeb77a5d92657390cc96dc8193c4e0 100644 (file)
@@ -141,9 +141,8 @@ $this->params['breadcrumbs'][] = $this->title;
             ],
             [
                 'attribute' => 'status_processing_1c',
-                'value' => function ($model) {
-                    return $model->status1c->status ?? null;
-                }
+                'value' => $model->status1C->status ?? null
+
             ],
             [
                 'attribute' => 'cancelled_order_sent',