| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace bizHd\auth\services;
- use bizHd\base\services\BaseService;
- use common\components\tree;
- use Yii;
- class AuthService extends BaseService
- {
-
- public static $baseFile = '\bizHd\auth\classes\AuthClass';
-
- //获取指定业务端的权限列表 ssh 2019.11.24
- public static function getEndAuth($endId)
- {
- return self::getAllByCondition(['endId' => $endId], null, '*');
- }
- //某业务端的权限id ssh 2019.11.25
- public static function getListId($endId)
- {
- $list = self::getEndAuth($endId);
- $ids = empty($list) ? [] : array_column($list,'id');
- return $ids;
- }
-
- //获取指定业务端的权限树
- public static function getTree($endId)
- {
- $data = self::getEndAuth($endId);
- if(empty($data)){
- return [];
- }
- $tree = tree::makeTree($data, ['primary_key' => 'id', 'parent_key' => 'parentId', 'children_key' => 'children',]);
- return $tree;
- }
- //获取业务端所有权限名称 ssh 2019.11.24
- public static function getNameList($endId)
- {
- $list = self::getEndAuth($endId);
- $arr = !empty($list) ? array_column($list, 'authName') : [];
- return $arr;
- }
- }
|