|
|
@@ -172,11 +172,12 @@ class User extends BaseController
|
|
|
$time = $request->param('time');
|
|
|
$times = $request->param('times');
|
|
|
$users = (new UserModel())
|
|
|
- ->where('parent_uid', '<>', 0)
|
|
|
- ->where('regtime', '>=', $time)
|
|
|
- ->where('regtime', '<=', $times)
|
|
|
- ->field('parent_uid as uid, count(*) as invite_count')
|
|
|
- ->group('parent_uid')
|
|
|
+ ->leftJoin('user u', 'u.uid = user.parent_uid')
|
|
|
+ ->where('user.parent_uid', '<>', 0)
|
|
|
+ ->where('user.regtime', '>=', $time)
|
|
|
+ ->where('user.regtime', '<=', $times)
|
|
|
+ ->field('user.parent_uid as uid, count(u.uid) as invite_count')
|
|
|
+ ->group('user.parent_uid')
|
|
|
->order('invite_count', 'desc')
|
|
|
->select();
|
|
|
$rankList = [];
|
|
|
@@ -197,7 +198,6 @@ class User extends BaseController
|
|
|
];
|
|
|
}
|
|
|
|
|
|
-
|
|
|
$inviteCount = array_column($rankList, 'invite_count');
|
|
|
$uid = array_column($rankList, 'uid');
|
|
|
array_multisort($inviteCount, SORT_DESC, $uid, SORT_ASC, $rankList);
|