Explorar o código

Update FixDuplicateProfiles command

Daniel Supernault %!s(int64=2) %!d(string=hai) anos
pai
achega
443acb8227
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      app/Console/Commands/FixDuplicateProfiles.php

+ 2 - 2
app/Console/Commands/FixDuplicateProfiles.php

@@ -155,8 +155,8 @@ class FixDuplicateProfiles extends Command
 
     protected function checkFollowers($id, $oid)
     {
-        Follower::whereProfileId($oid)->update(['profile_id' => $id]);
-        Follower::whereFollowingId($oid)->update(['following_id' => $id]);
+        Follower::whereProfileId($oid)->where('profile_id', '!=', $id)->update(['profile_id' => $id]);
+        Follower::whereFollowingId($oid)->where('following_id', '!=', $id)->update(['following_id' => $id]);
     }
 
     protected function checkHashtagFollow($id, $oid)