no message
This commit is contained in:
@@ -232,6 +232,20 @@ class Project extends AbstractModel
|
||||
return $this->projectUser->pluck('userid')->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员id是否在项目里
|
||||
* @param int $userid
|
||||
* @return int 0:不存在、1存在、2存在且是管理员
|
||||
*/
|
||||
public function useridInTheProject($userid)
|
||||
{
|
||||
$user = ProjectUser::whereProjectId($this->id)->whereUserid(intval($userid))->first();
|
||||
if (empty($user)) {
|
||||
return 0;
|
||||
}
|
||||
return $user->owner ? 2 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目
|
||||
* @return bool
|
||||
|
||||
Reference in New Issue
Block a user