Guest User

Untitled

a guest
Dec 13th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1.     return $this->fetchAll(
  2.             $this->select
  3.                 ->from(array('p' => $this->_name), array(
  4.                 'privilegeId' => 'p.id',
  5.                 'resources' => new Zend_Db_Expr("GROUP_CONCAT(CONCAT_WS('-', re.id, re.name) SEPARATOR ',')")
  6.                     )
  7.                 )
  8.                 ->join(array('re' => 'resource'), 're.id = p.resource', array(''))
  9.                 ->join(array('ro' => 'role'), 'ro.id = p.role', array('roleId' => 'ro.id', 'roleName' => 'ro.name'))
  10.                 ->order('p.id ASC')
  11.                 ->group('ro.name')
  12.     );
Add Comment
Please, Sign In to add comment