mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-08 20:46:05 +00:00
minor simplification of sql statement
This commit is contained in:
parent
1d031e44a2
commit
adba550a63
|
@ -284,7 +284,7 @@ class SeedDMS_Core_Group { /* {{{ */
|
|||
* set to true, otherwise does not care about manager status
|
||||
* @return boolean true if user is member, otherwise false
|
||||
*/
|
||||
function isMember($user,$asManager=false) { /* {{{ */
|
||||
function isMember($user, $asManager=false) { /* {{{ */
|
||||
if (isset($this->_users)&&!$asManager) {
|
||||
foreach ($this->_users as $usr)
|
||||
if ($usr->getID() == $user->getID())
|
||||
|
@ -293,8 +293,9 @@ class SeedDMS_Core_Group { /* {{{ */
|
|||
}
|
||||
|
||||
$db = $this->_dms->getDB();
|
||||
if ($asManager) $queryStr = "SELECT * FROM `tblGroupMembers` WHERE `groupID` = " . $this->_id . " AND `userID` = " . $user->getID() . " AND `manager` = 1";
|
||||
else $queryStr = "SELECT * FROM `tblGroupMembers` WHERE `groupID` = " . $this->_id . " AND `userID` = " . $user->getID();
|
||||
$queryStr = "SELECT * FROM `tblGroupMembers` WHERE `groupID` = " . $this->_id . " AND `userID` = " . $user->getID();
|
||||
if ($asManager)
|
||||
$queryStr .= " AND `manager` = 1";
|
||||
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user