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];