From 4011075698a3b974c4140a139f57cc8f137a784e Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Sat, 27 Jul 2024 10:08:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/IndexLogic.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/api/logic/IndexLogic.php b/app/api/logic/IndexLogic.php index faca22ee..46bdd3e3 100644 --- a/app/api/logic/IndexLogic.php +++ b/app/api/logic/IndexLogic.php @@ -973,16 +973,20 @@ class IndexLogic extends Logic private static function getIndexHotList() { + $hot_list = $order_goods = []; + $hot_list = Db::name('hot_list') ->alias('hl') ->join('goods g', 'hl.goods_id = g.id') ->where('delete_time', 0) ->field('hl.*, g.id as gid, g.name, g.image, g.issuing_price, g.market_price, g.min_price, g.purchase_price, g.wholesale_price') + ->order('sort desc') ->limit(6) ->select() ->toArray(); $count = count($hot_list); + if ($count < 6) { $where[] = ['og.create_time', '>=', strtotime("today")]; $where[] = ['og.create_time', '<=', strtotime("tomorrow") - 1];