dever 3 년 전
부모
커밋
f038130b0d
2개의 변경된 파일17개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      database/relation.php
  2. 14 0
      src/Api.php

+ 3 - 3
database/relation.php

@@ -78,7 +78,7 @@ return array
 		'getChild' => array
 		(
 			# 匹配的正则或函数 选填项
-			'where' => array
+			'option' => array
 			(
 				'uid' => 'yes',
 				'level' => array('yes', '<='),
@@ -92,7 +92,7 @@ return array
 		'getChildCount' => array
 		(
 			# 匹配的正则或函数 选填项
-			'where' => array
+			'option' => array
 			(
 				'uid' => 'yes',
 				'level' => array('yes', '<='),
@@ -106,7 +106,7 @@ return array
 		'getParent' => array
 		(
 			# 匹配的正则或函数 选填项
-			'where' => array
+			'option' => array
 			(
 				'to_uid' => 'yes',
 				'level' => array('yes', '<='),

+ 14 - 0
src/Api.php

@@ -65,6 +65,12 @@ class Api
 		return $relation->getChild($uid, $level);
 	}
 
+    public function getChildNum($uid, $level = false)
+    {
+        $relation = new Relation();
+        return $relation->getChildNum($uid, $level);
+    }
+
 	# 获取某个用户的上级
 	public function getParent($uid, $level = 1)
 	{
@@ -76,6 +82,14 @@ class Api
 		return false;
 	}
 
+    # 获取某个用户的上级
+    public function getParentAll($uid, $level = 1)
+    {
+        $relation = new Relation();
+        $info = $relation->getParentAll($uid, $level);
+        return $info;
+    }
+
 	# 获取来源用户uid
 	public function getSourceUid($uid, $error = true)
     {