/** * 获取一个人的组织类型 * 门市、代理商、组团社、提供商 * @author wjh 20141113 * @param null $userid * @return string * @throws Exception */ public static function getOrgType($userid = null) { if (empty($userid)) { $userid = BDataHelper::getCurrentUserid(); } $isRole = BDataHelper::checkCurrentUserRole('group_'); if ($isRole) { return GroupTransaction::ORGTYPE_GROUP; } $isRole = BDataHelper::checkCurrentUserRole('sales_'); if ($isRole) { return GroupTransaction::ORGTYPE_SALES; } $isRole = BDataHelper::checkCurrentUserRole('provider_'); if ($isRole) { return GroupTransaction::ORGTYPE_PROVIDER; } $isRole = BDataHelper::checkCurrentUserRole('agent_'); if ($isRole) { return GroupTransaction::ORGTYPE_AGENT; } return GroupTransaction::ORGTYPE_SALES; }