From 6434d031ca0f8217877e399a5dae2582bd6b59ef Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Wed, 16 Jul 2025 15:32:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=A7=E5=93=81=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Product.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/index/controller/Product.php b/app/index/controller/Product.php index abc84bcb..92610575 100644 --- a/app/index/controller/Product.php +++ b/app/index/controller/Product.php @@ -104,7 +104,7 @@ class Product extends Common ->onSale(true) ->onShelves(true) ->append(['p' => $list[0]['id']]) - ->order(['sort' => 'asc', 'id' => 'desc']) + ->order(['sort' => 'asc', 'created_at' => 'desc', 'id' => 'desc']) ->limit(5) ->buildSql(); $query = \think\facade\Db::table("($sql) as a"); @@ -126,7 +126,7 @@ class Product extends Common ->enabled(true) ->onSale(true) ->onShelves(true) - ->order(['sort' => 'asc', 'id' => 'desc']) + ->order(['sort' => 'asc', 'created_at' => 'desc', 'id' => 'desc']) ->limit(5); }); } @@ -192,7 +192,7 @@ class Product extends Common ->enabled(true) ->onSale(true) ->onShelves(true) - ->order(['sort' => 'asc', 'id' => 'desc']) + ->order(['sort' => 'asc', 'created_at' => 'desc', 'id' => 'desc']) ->select(); if (!$products->isEmpty()) { // 获取sku信息