From 05e9490686e430037fd36530a2fd2c6c978fe272 Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Mon, 13 Oct 2025 12:24:06 +0300 Subject: [PATCH] =?utf8?q?=D0=A4=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D1=83=D0=B5?= =?utf8?q?=D0=BC=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=B7=D0=B0?= =?utf8?q?=D0=BA=D0=B0=D0=B7=D1=8B=20=D1=81=20=D0=B7=D0=B0=D0=BF=D0=BE?= =?utf8?q?=D0=BB=D0=BD=D0=B5=D0=BD=D0=BD=D1=8B=D0=BC=20status=5Fprocessing?= =?utf8?q?=5F1C?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/api2/controllers/OrdersController.php | 2 +- erp24/controllers/MarketplaceOrdersController.php | 10 +++++++++- erp24/records/MarketplaceOrdersSearch.php | 1 + erp24/views/marketplace-orders/index.php | 2 +- erp24/views/marketplace-orders/view.php | 5 ++--- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/erp24/api2/controllers/OrdersController.php b/erp24/api2/controllers/OrdersController.php index ddd97971..355673b3 100644 --- a/erp24/api2/controllers/OrdersController.php +++ b/erp24/api2/controllers/OrdersController.php @@ -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]) diff --git a/erp24/controllers/MarketplaceOrdersController.php b/erp24/controllers/MarketplaceOrdersController.php index 3bbf07f8..10ca79ad 100644 --- a/erp24/controllers/MarketplaceOrdersController.php +++ b/erp24/controllers/MarketplaceOrdersController.php @@ -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; } diff --git a/erp24/records/MarketplaceOrdersSearch.php b/erp24/records/MarketplaceOrdersSearch.php index 1bd1a2a8..6b407460 100644 --- a/erp24/records/MarketplaceOrdersSearch.php +++ b/erp24/records/MarketplaceOrdersSearch.php @@ -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([ diff --git a/erp24/views/marketplace-orders/index.php b/erp24/views/marketplace-orders/index.php index 5eaf7bf9..22c02cae 100644 --- a/erp24/views/marketplace-orders/index.php +++ b/erp24/views/marketplace-orders/index.php @@ -175,7 +175,7 @@ YiiAsset::register($this); [ 'attribute' => 'status_processing_1c', 'value' => function ($model) { - return $model->status1c->status ?? null; + return $model->status1C->status ?? null; } ], [ diff --git a/erp24/views/marketplace-orders/view.php b/erp24/views/marketplace-orders/view.php index be021aea..f2458eac 100644 --- a/erp24/views/marketplace-orders/view.php +++ b/erp24/views/marketplace-orders/view.php @@ -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', -- 2.39.5