@@ -560,8 +560,8 @@ WHERE u.TenantId={tenantId} and u.MallBaseId={mallBaseId} and u.SuperiorId ={use
dmodel.OrderBy=" Id asc";
}
stringsql=$@" select * from ( SELECT a.Id,a.Source,a.`Name`,a.AliasName,a.Photo, b.TotalCommission,b.Price,c.Commission,d.ChildrenNum,
(SELECT COUNT(*) from rb_member_user where FIND_IN_SET( Id ,(SELECT GetMemberChildrenList(a.Id)))) as AllChildrenNum ,
(SELECT COUNT(*) from rb_goods_order where OrderStatus!=7 and FIND_IN_SET( UserId ,(SELECT GetMemberChildrenList(a.Id)))) as OrderNum
0 as AllChildrenNum ,
0 as OrderNum
from rb_member_user as a
LEFT JOIN (SELECT UserId,MAX(TotalCommission) as TotalCommission,SUM(IFNULL(TotalCommission,0)-IFNULL(CommissionWithdrawal,0)) as Price from rb_distributor_info GROUP BY UserId) as b on a.Id=b.UserId