SELECT T1.`uid`,T1.`headimg`, T1.`nickname` ,T1.`referer` ,T2.`num` FROM `user_center` AS T1 LEFT JOIN ( SELECT C.`referer` AS uid, count(`referer`) AS num FROM `user_center` C, `user_open` O WHERE C.`uid`= O.`uid` AND O.`subscribe`=1 GROUP BY C.`referer` ) AS T2 ON T1.`uid`= T2.`uid` WHERE T2.`num` IS NOT NULL ORDER BY T2.`num` DESC