FROM RB_Course_Category AS A LEFT JOIN (SELECT COUNT(1) AS CourseCount,CateId FROM rb_course WHERE `Status`=0 GROUP BY CateId) AS B ON A.CateId=B.CateId
FROM RB_Course_Category AS A
LEFT JOIN (SELECT COUNT(1) AS CourseCount,CateId FROM rb_course WHERE `Status`=0 GROUP BY CateId) AS B ON A.CateId=B.CateId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Course_Category_ViewModel.Status),(int)DateStateEnum.Normal);
...
...
@@ -79,10 +80,6 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Course_Category_ViewModel.Group_Id),query.Group_Id);
}
//if (query.School_Id > 0)
//{
// builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Category_ViewModel.School_Id), query.School_Id);
//}
if(query.CateId>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Course_Category_ViewModel.CateId),query.CateId);
...
...
@@ -96,6 +93,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Course_Category_ViewModel.ParentId),query.ParentId);
}
if(query.CourseSubject>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Course_Category_ViewModel.CourseSubject),(int)query.CourseSubject);
}
}
builder.AppendFormat(@" ORDER BY A.{0} ASC ",nameof(RB_Course_Category_ViewModel.SortNum));