@@ -223,7 +223,7 @@ from RB_Sell_Achievements_Details r where {where} order by r.Id asc";
}
stringsql=$@" select r.UserId,r.Depart_Id,r.School_Id,sum(r.StudentCount) as StudentCount,sum(r.CurrentPeriodMoney + r.DeductionMoney) as CurrentPeriodMoney
stringsql=$@" select r.UserId,r.Depart_Id,r.School_Id,sum(r.StudentCount) as StudentCount,sum(r.CurrentPeriodMoney + r.DeductionMoney) as CurrentPeriodMoney,sum(r.PeopleNumMoney) as PeopleNumMoney
from RB_Sell_Achievements_Details r where {where} group by r.UserId,r.Depart_Id,r.School_Id";
stringsql=$@"SELECT e.*,(o.Income + o.PlatformTax -o.Refund) as OrderMoney FROM rb_sell_achievements_emp e
stringsql=$@"SELECT e.*,(o.Income - o.Refund - o.CoursewareFee - o.TotalClassHours) as OrderMoney,o.Refund FROM rb_sell_achievements_emp e
LEFT JOIN rb_order o on e.OrderId =o.OrderId
WHERE e.Group_Id={group_Id} and (e.Type=2 or (e.Type=1 and e.IsDept=1)) and e.OrderSaleMoney <> (o.Income + o.PlatformTax -o.Refund) and e.OrderId>0 and e.Remark not like '%退款回扣%'
WHERE e.Group_Id={group_Id} and o.CreateTime >='2023-10-01' and (e.Type=2 or (e.Type=1 and e.IsDept=1)) and e.OrderSaleMoney <> (o.Income - o.Refund - o.CoursewareFee - o.TotalClassHours) and e.OrderId>0 and e.Remark not like '%退款回扣%'