rabin 3 anos atrás
pai
commit
00596555cd
3 arquivos alterados com 23 adições e 4 exclusões
  1. 14 0
      database/relation.php
  2. 7 2
      lib/Relation.php
  3. 2 2
      src/Api.php

+ 14 - 0
database/relation.php

@@ -88,6 +88,20 @@ return array
 	'request' => array
 	(
 		'getChild' => array
+		(
+			# 匹配的正则或函数 选填项
+			'option' => array
+			(
+				'uid' => 'yes',
+				'level' => array('yes', '<='),
+				'end' => array('yes-cdate', '<=')
+			),
+			'type' => 'all',
+			'order' => array('id' => 'desc'),
+			'col' => '*',
+		),
+
+		'getChildByPage' => array
 		(
 			# 匹配的正则或函数 选填项
 			'option' => array

+ 7 - 2
lib/Relation.php

@@ -80,13 +80,18 @@ class Relation
     }
 
     # 获取某个用户的下级数据
-    public function getChild($uid, $level = false)
+    public function getChild($uid, $level = false, $page = true)
     {
         $where['uid'] = $uid;
         if ($level) {
             $where['level'] = $level;
         }
-        return Dever::db('invite/relation')->getChild($where);
+        if ($page) {
+            return Dever::db('invite/relation')->getChildByPage($where);
+        } else {
+            return Dever::db('invite/relation')->getChild($where);
+        }
+        
     }
 
     # 获取某个用户在x小时之内的下级数据

+ 2 - 2
src/Api.php

@@ -81,10 +81,10 @@ class Api
 	}
 
 	# 获取某个用户的下级
-	public function getChild($uid, $level = false)
+	public function getChild($uid, $level = false, $page = true)
 	{
 		$relation = new Relation();
-		return $relation->getChild($uid, $level);
+		return $relation->getChild($uid, $level, $page);
 	}
 
     public function getChildNum($uid, $level = false)