public static function getPersonsByRole($role = false){
        $ccuc_status = CcucUserCompany::CCUC_STATUS_SYS;
        $sys_ccmp_id = Yii::app()->sysCompany->getActiveCompany();
        $sql = " 
            SELECT DISTINCT
                
              pprs_id,
              CONCAT(
                pprs_second_name,
                ' ',
                pprs_first_name
              ) full_name 
            FROM
              AuthAssignment aa 
              INNER JOIN `profiles` p 
                ON aa.userid = p.user_id 
              INNER JOIN pprs_person 
                ON p.person_id = pprs_id 
              INNER JOIN ccuc_user_company 
                ON pprs_id = ccuc_person_id 
                AND ccuc_ccmp_id = {$sys_ccmp_id} 
                AND ccuc_status = '{$ccuc_status}' 

                   "
            ;
            
            $where = '';
            if($role && !is_array($role)){
                $where = " WHERE itemname = '{$role}' ";
            }

            if($role && is_array($role)){
                $where = " WHERE itemname in ('".implode("','",$role)."') ";
            }
            
            $sql .= $where . " ORDER BY pprs_second_name,pprs_first_name ";

            return Yii::app()->db->createCommand($sql)->queryAll();
    
    }