@@ -170,7 +170,216 @@ SELECT A.CreateBy,COUNT(1) AS FollowCount
FROM rb_student_follow AS A INNER JOIN(SELECT StuId,CreateBy,MIN(Id) AS Id FROM rb_student_follow WHERE `Status`=0 GROUP BY StuId,CreateBy) AS B ON A.Id=B.Id
INNER JOIN RB_student AS C ON A.StuId=C.StuId
WHERE A.Status=0 AND C.Status=0 AND C.StuStage<>7 {0}
GROUP BY A.CreateBy
";
if(query.CreateBy>0)
{
sql+=string.Format(" AND A.CreateBy={0} ",query.CreateBy);
}
sql+=" GROUP BY A.CreateBy ";
stringtodayWhere="";
if(!string.IsNullOrEmpty(query.STime))
{
todayWhere+=string.Format(" AND to_days(A.CreateTime)=to_days('{0}') ",query.STime);
}
else
{
todayWhere+=string.Format(" AND to_days(A.CreateTime)=to_days(now()) ");