From 7ebe4cd0153b78fff588d32a32c9cfd81d8a69a8 Mon Sep 17 00:00:00 2001 From: Terry <2358269014@qq.com> Date: Tue, 1 Oct 2019 09:49:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8A=A0=E5=85=A5=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/cart/QuoteItem.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/cart/QuoteItem.php b/services/cart/QuoteItem.php index 292fc89a..5d38717b 100644 --- a/services/cart/QuoteItem.php +++ b/services/cart/QuoteItem.php @@ -270,7 +270,8 @@ class QuoteItem extends Service if (!isset($this->_cart_product_info[$cart_id])) { $data = $this->_itemModel->find()->where([ 'cart_id' => $cart_id, - ])->all(); + ])->orderBy( ['active' => SORT_ASC, 'updated_at' => SORT_DESC]) // 加入按照active updated_at 进行排序 + ->all(); if (is_array($data) && !empty($data)) { foreach ($data as $one) { $active = $one['active']; -- GitLab