shish 6 лет назад
Родитель
Сommit
d24386b4e7
2 измененных файлов с 22 добавлено и 9 удалено
  1. 9 9
      biz/auth/services/AuthService.php
  2. 13 0
      biz/saas/services/SetAuthService.php

+ 9 - 9
biz/auth/services/AuthService.php

@@ -11,24 +11,24 @@ class AuthService extends BaseService
 	
 	public static $baseFile = '\biz\auth\classes\AuthClass';
 	
-	//根据业务端获取权限树
+	//获取指定业务端的权限列表 shish 2019.11.24
+	public static function getList($endId)
+	{
+		return self::getAllByCondition(['endId' => $endId], null, '*');
+	}
+
+	//获取指定业务端的权限树
 	public static function getTree($endId)
 	{
-		$data = self::getAllByCondition(['endId' => $endId], null, '*');
+		$data = self::getList($endId);
 		$tree = tree::makeTree($data, ['primary_key' => 'id', 'parent_key' => 'parentId', 'children_key' => 'children',]);
 		return $tree;
 	}
-	
-	//取出业务端所有的权限 shish 2019.11.24
-	public static function getAuthData($endId)
-	{
-		return self::getAllByCondition(['endId' => $endId], null, '*');
-	}
 
 	//获取业务商所有权限名称 shish 2019.11.24
 	public static function getNameList($endId)
 	{
-		$list = self::getAuthData($endId);
+		$list = self::getList($endId);
 		$arr = [];
 		if (!empty($list)) {
 			$arr = array_column($list, 'authName');

+ 13 - 0
biz/saas/services/SetAuthService.php

@@ -1,6 +1,7 @@
 <?php
 
 namespace biz\saas\services;
+use biz\auth\services\AuthService;
 use biz\base\services\BaseService;
 use Yii;
 
@@ -9,4 +10,16 @@ class SetAuthService extends BaseService
 
 	public static $baseFile = '\biz\saas\classes\SetAuthClass';
 
+	//获取指定套餐和业务端的权限列表
+	public static function getAuthList($setId,$endId)
+	{
+		$list = AuthService::getList($endId);
+	}
+
+	//获取指定套餐和业务端的权限树
+	public static function getAuthTree($setId,$endId)
+	{
+		$tree = AuthService::getTree($endId);
+	}
+
 }