rabin 1 rok temu
rodzic
commit
bcb57d5b15
2 zmienionych plików z 12 dodań i 3 usunięć
  1. 3 2
      database/relation.php
  2. 9 1
      lib/Relation.php

+ 3 - 2
database/relation.php

@@ -100,7 +100,7 @@ return array
 			//'order' => array('level' => 'asc','id' => 'desc'),
             'group' => 'to_uid',
 			'order' => array('cdate' => 'desc'),
-			'col' => '*',
+			'col' => '*|to_uid',
 		),
 
 		'getChildByPage' => array
@@ -127,7 +127,8 @@ return array
 			(
 				'uid' => 'yes',
 				'level' => array('yes', '<='),
-				'end' => array('yes-cdate', '<=')
+				'start' => array('yes-cdate', '>='),
+				'end' => array('yes-cdate', '<='),
 			),
 			'type' => 'count',
 			'order' => array('id' => 'desc'),

+ 9 - 1
lib/Relation.php

@@ -119,12 +119,13 @@ class Relation
     }
 
     # 获取某个用户在x小时之内的下级数据
-    public function getChildNum($uid, $level = 1, $time = false, $curtime = false, $method = 'count')
+    public function getChildNum($uid, $level = 1, $start = false, $end = false, $method = 'count')
     {
         $where['uid'] = $uid;
         if ($level) {
             $where['level'] = $level;
         }
+        /*
         if ($time) {
             $time = $time * 3600;
             if ($curtime) {
@@ -137,6 +138,13 @@ class Relation
             }
             $where['end'] = $cur + $time;
         }
+        */
+        if ($start) {
+            $where['start'] = Dever::maketime($start);
+        }
+        if ($end) {
+            $where['end'] = Dever::maketime($end);
+        }
 
         if ($method == 'count') {
             $method = 'getChildCount';