From dd535c1b9935808f33f0eb836fde6cc6a2564bff Mon Sep 17 00:00:00 2001 From: Luke Holder Date: Mon, 24 Jun 2024 15:52:50 +0800 Subject: [PATCH] Fix #3554 --- src/controllers/OrderStatusesController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/OrderStatusesController.php b/src/controllers/OrderStatusesController.php index d72d1ce843..dd5f956ff6 100644 --- a/src/controllers/OrderStatusesController.php +++ b/src/controllers/OrderStatusesController.php @@ -127,7 +127,10 @@ public function actionSave(): void } if (!$id) { - $orderStatus->sortOrder = (new Query())->from(Table::ORDERSTATUSES)->where(['storeId' => $storeId])->max('sortOrder') + 1; + $orderStatus->sortOrder = (new Query()) + ->from(Table::ORDERSTATUSES) + ->where(['storeId' => $storeId]) + ->max("[[sortOrder]]") + 1; } // Save it