roman.lesnikov@gmail.com 3 лет назад
Родитель
Сommit
c5a503512e

+ 6 - 2
modules/base/groups/classes/BxBaseModGroupsDb.php

@@ -75,9 +75,13 @@ class BxBaseModGroupsDb extends BxBaseModProfileDb
         return true;
         return true;
     }
     }
 
 
-    public function deleteAdminsByGroupId ($iGroupProfileId)
+    public function deleteAdminsByGroupId ($iGroupProfileId, $iProfileId = 0)
     {
     {
-        $sQuery = $this->prepare("DELETE FROM `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` WHERE `group_profile_id` = ?", $iGroupProfileId);
+        if ($iProfileId != 0)
+            $sQuery = $this->prepare("DELETE FROM `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` WHERE `group_profile_id` = ? AND `fan_id` = ?", $iGroupProfileId, $iProfileId);
+        else
+            $sQuery = $this->prepare("DELETE FROM `" . $this->_oConfig->CNF['TABLE_ADMINS'] . "` WHERE `group_profile_id` = ?", $iGroupProfileId);
+        
         return $this->res($sQuery);
         return $this->res($sQuery);
     }
     }
 
 

+ 1 - 1
modules/base/groups/classes/BxBaseModGroupsGridConnections.php

@@ -349,7 +349,7 @@ class BxBaseModGroupsGridConnections extends BxDolGridConnections
         }
         }
 
 
         // delete admin associated with profile
         // delete admin associated with profile
-        $this->_oModule->_oDb->deleteAdminsByProfileId($iProfileId);
+        $this->_oModule->_oDb->deleteAdminsByGroupId($iGroupProfileId, $iProfileId);
 
 
         return parent::_delete ($mixedId);
         return parent::_delete ($mixedId);
     }
     }