Commit fbe29b74 authored by liudong1993's avatar liudong1993

1

parent e63e0857
......@@ -1800,17 +1800,16 @@ LEFT JOIN rb_member_user u on v.UserId = u.Id
string sql = $@"SELECT tt.UserId as Id,u.`Name`,u1.`Name` as PName1,u2.`Name` as PName2,u3.`Name` as PName3,o2.OrderId as ShopId FROM(
SELECT * FROM (
SELECT UserId,COUNT(0) as Count FROM rb_goods_order o WHERE o.OrderStatus <> 1 and o.OrderStatus <> 7 and o.Recycled=2
and o.`Status`=0 and o.CreateDate >= '{startTime}' AND o.CreateDate < '{endTime} 23:59:59'
and o.`Status`=0 and o.CreateDate >= '{startTime}' AND o.CreateDate < '{endTime} 23:59:59' and o.MallBaseId ={mallbaseId}
GROUP BY UserId)t
WHERE t.Count =1 and (SELECT COUNT(0) AS Count1 FROM rb_goods_order o1 WHERE o1.UserId = t.UserId and o1.OrderStatus <> 1
WHERE (SELECT COUNT(0) AS Count1 FROM rb_goods_order o1 WHERE o1.UserId = t.UserId and o1.OrderStatus <> 1
and o1.OrderStatus <> 7 and o1.Recycled=2 and o1.`Status`=0 and o1.MallBaseId ={mallbaseId} and o1.CreateDate < '{startTime}')=0
)tt
LEFT JOIN rb_member_user u on tt.UserId = u.Id
LEFT JOIN rb_member_user u1 on u.SuperiorId = u1.Id
LEFT JOIN rb_member_user u2 on u1.SuperiorId = u2.Id
LEFT JOIN rb_member_user u3 on u2.SuperiorId = u3.Id
LEFT JOIN rb_goods_order o2 on o2.UserId = tt.UserId
WHERE o2.TenantId = 1 and o2.OrderStatus <> 1 and o2.OrderStatus <> 7 and o2.Recycled=2 and o2.`Status`=0 and o2.MallBaseId ={mallbaseId} and o2.CreateDate <='{endTime} 23:59:59'";
LEFT JOIN rb_goods_order o2 on o2.UserId = tt.UserId and o2.TenantId = 1 and o2.OrderStatus <> 1 and o2.OrderStatus <> 7 and o2.Recycled=2 and o2.`Status`=0 and o2.MallBaseId ={mallbaseId} and o2.CreateDate <='{endTime} 23:59:59'";
return Get<RB_Member_User_Extend>(sql).ToList();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment