From f01afc88dd350d6569d3c1d4525c65ed51e83cdf Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Thu, 18 Apr 2024 00:28:09 +0800 Subject: [PATCH] 1 --- app/api/model/Goods.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/api/model/Goods.php b/app/api/model/Goods.php index 30fd4594..db63360c 100644 --- a/app/api/model/Goods.php +++ b/app/api/model/Goods.php @@ -242,7 +242,6 @@ class Goods extends GoodsModel public function presaleGoods(array $param): array { $list = []; - $cate_goods_id = []; $model = new PreSale(); $info = $model->where(['is_change' => 0, 'status' => 1])->field('goods_list,p_time')->find(); if (!$info->isEmpty()) { @@ -256,11 +255,10 @@ class Goods extends GoodsModel ->column('distinct goods_id'); if (!$cate_goods_id) { return $list; + } else { + $goods_ids = $cate_goods_id; } } - if ($cate_goods_id) { - $goods_ids = $cate_goods_id; - } $result = $this->getListByIds($goods_ids); if (!$result->isEmpty()) { $result = $result->toArray();