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(); }