+ Add func to find the issue by object type and id.

This commit is contained in:
dingguodong
2021-06-24 13:15:55 +08:00
parent b3248d2105
commit 49af2b3bb1
+24 -8
View File
@@ -56,7 +56,7 @@ class gitlabModel extends model
*/
public function getUserIdAccountPairs($gitlab)
{
return $this->dao->select('openID,account')->from(TABLE_OAUTH)->where('providerType')->eq('gitlab')->andwhere('providerID')->eq($gitlab)->fetchPairs();
return $this->dao->select('openID,account')->from(TABLE_OAUTH)->where('providerType')->eq('gitlab')->andWhere('providerID')->eq($gitlab)->fetchPairs();
}
/**
@@ -68,7 +68,7 @@ class gitlabModel extends model
*/
public function getUserAccountIdPairs($gitlab)
{
return $this->dao->select('account,openID')->from(TABLE_OAUTH)->where('providerType')->eq('gitlab')->andwhere('providerID')->eq($gitlab)->fetchPairs();
return $this->dao->select('account,openID')->from(TABLE_OAUTH)->where('providerType')->eq('gitlab')->andWhere('providerID')->eq($gitlab)->fetchPairs();
}
/**
@@ -772,11 +772,27 @@ class gitlabModel extends model
*/
public function getAccount($gitlabID, $userID)
{
return $this->dao->select('account')
->from(TABLE_OAUTH)
->where('providerType')->eq('gitlab')
->andwhere('providerID')->eq($gitlabID)
->andwhere('openID')->eq($userID)
->fetch('account');
return $this->dao->select('account')->from(TABLE_OAUTH)
->where('providerType')->eq('gitlab')
->andWhere('providerID')->eq($gitlabID)
->andWhere('openID')->eq($userID)
->fetch('account');
}
/**
* Get gitlab issue from relation by object type and id.
*
* @param string $objectType
* @param int $objectID
* @access public
* @return object
*/
public function getGitlabIssueFromRelation($objectType,$objectID)
{
return $this->dao->select('extra as gitlabID,BVersion as projectID,BID as issueID,AType,AID')->from(TABLE_RELATION)
->where('relation')->eq('gitlab')
->andWhere('AType')->eq($objectType)
->andWhere('AID')->eq($objectID)
->fetch();
}
}