From 16fa01085a747a3a1341dfe4feb9bace960993b3 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 28 Sep 2023 15:28:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81=E6=8E=A8?= =?UTF-8?q?=E8=8D=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/product/ProductRepository.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 937a2a86..5e72865f 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -1167,6 +1167,8 @@ class ProductRepository extends BaseRepository $where['product_type'] = $productType; } $res = $this->dao->getWhere($where, $field, $with); + $a= $this->getRecommend($res['product_id'], $res['mer_id']); + halt($a); if (!$res) return []; switch ($res['product_type']) { case 0: @@ -1323,19 +1325,17 @@ class ProductRepository extends BaseRepository ->where('mer_id',$merId); $data = []; $count = $query->count(); - - if ($count < 3) { - $productIds[] = $productId; - $data = $this->dao->getSearch([]) - ->where($this->dao->productShow()) - ->whereNotIn('product_id',$productIds) - ->where('mer_id', $merId) - ->field('mer_id,product_id,store_name,image,price,is_show,status,is_gift_bag,is_good,sales,create_time') - ->order('sort DESC,create_time DESC') - ->limit((3 - $count)) - ->select()->toArray(); - } - + // if ($count < 3) { + // $productIds[] = $productId; + // $data = $this->dao->getSearch([]) + // ->where($this->dao->productShow()) + // ->whereNotIn('product_id',$productIds) + // ->where('mer_id', $merId) + // ->field('mer_id,product_id,store_name,image,price,is_show,status,is_gift_bag,is_good,sales,create_time') + // ->order('sort DESC,create_time DESC') + // ->limit((3 - $count)) + // ->select()->toArray(); + // } if ($count > 0 ){ $count = $count > 3 ? 3 : $count; $res = $query->setOption('field',[])->field('mer_id,product_id,store_name,image,price,is_show,status,is_gift_bag,is_good,sales,create_time')