From 996ed2d104342dea835118d7ac1d63e9ec672aed Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Wed, 26 Jul 2023 14:02:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8F=96=E6=B6=88=E6=94=B6?= =?UTF-8?q?=E8=97=8F=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/user/UserRelationRepository.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/common/repositories/user/UserRelationRepository.php b/app/common/repositories/user/UserRelationRepository.php index 1520cab2..d4b5df93 100644 --- a/app/common/repositories/user/UserRelationRepository.php +++ b/app/common/repositories/user/UserRelationRepository.php @@ -181,15 +181,11 @@ class UserRelationRepository extends BaseRepository { if ($type == 10) { app()->make(MerchantRepository::class)->decCareCount($ids); - $type_id = $ids; } else { - foreach ($ids as $id) { - $spu = $this->getSpu(['type_id' => $id, 'type' => $type]); - $type_id[] = $spu->spu_id; - } $type = 1; app()->make(ProductRepository::class)->decCareCount($ids); } + $type_id = $ids; return $this->dao->search(['uid' => $uid,'type' => $type])->where('type_id','in',$type_id)->delete(); }