diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index 9294b046..d44343fa 100755 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -19,6 +19,7 @@ namespace app\api\controller; use app\api\logic\DistributionLogic; +use app\api\logic\IndexLogic; use app\common\basics\Api; use app\api\logic\GoodsLogic; use app\common\model\goods\GoodsItem; @@ -275,6 +276,7 @@ class Goods extends Api return JsonServer::error('暂无数据'); } } + /** * 热销榜单 */ @@ -349,6 +351,15 @@ class Goods extends Api } } + // 年货超值购 + public function yearList() + { + $page = $this->request->get('page_no', $this->page_no); + $size = $this->request->get('page_size', $this->page_size); + $list = IndexLogic::getYearGoods($page, $size); + + return JsonServer::success('获取成功', $list); + } // 2024-07-26 新版获取热销榜单 public function hotList() @@ -370,5 +381,4 @@ class Goods extends Api $list = GoodsLogic::goodsList($type, $page, $size); return JsonServer::success('获取成功', $list); } - } \ No newline at end of file diff --git a/app/api/logic/IndexLogic.php b/app/api/logic/IndexLogic.php index 14a93a47..a1f53dad 100755 --- a/app/api/logic/IndexLogic.php +++ b/app/api/logic/IndexLogic.php @@ -1123,11 +1123,8 @@ class IndexLogic extends Logic return $hot_list; } - public static function getYearGoods($get = []) + public static function getYearGoods($page_no = 1, $page_size = 10) { - $page_no = $get['page_no'] ?? 1; - $page_size = $get['page_size'] ?? 10; - // 销售中商品:未删除/审核通过/已上架 $where = [ ['del', '=', GoodsEnum::DEL_NORMAL], // 未删除