StringBuildersql=newStringBuilder("select CourseId,CourseName,(select Count(0) from rb_course_chapter b where b.CourseId=a.CourseId and ParentId=0 and b.`Status`=0) as UnitCount,(select Count(0) from rb_course_chapter b where b.CourseId=a.CourseId and ParentId>0 and b.`Status`=0) as ChapterCount from rb_course a where Status=0");
sql.AppendFormat(" AND a.{0}={1} ",nameof(RB_Course_ViewModel.Group_Id),groupId);
SELECT A.*,IFNULL(B.MenuName,'') AS MenuName,IFNULL(B.MenuUrl,'') AS MenuUrl
FROM RB_Menu_Function AS A LEFT JOIN rb_menu AS B ON A.MenuId=B.MenuId
WHERE 1=1 AND A.Status=0 AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermission WHERE Role_Id IN (SELECT RoleId FROM rb_post_role WHERE PostId IN({0})))
WHERE 1=1 AND A.Status=0
AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermission WHERE Role_Id IN (SELECT RoleId FROM rb_post_role WHERE PostId IN({0})))
@@ -117,7 +118,8 @@ WHERE 1=1 AND A.Status=0 AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermi
builder.AppendFormat(@"
SELECT 1
FROM RB_Menu_Function AS A
WHERE 1=1 AND A.FunctionCode='{0}' AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermission WHERE Role_Id IN (SELECT RoleId FROM rb_post_role WHERE PostId IN({1})))
WHERE 1=1 AND A.FunctionCode='{0}'
AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermission WHERE Role_Id IN (SELECT RoleId FROM rb_post_role WHERE PostId IN({1})))
stringsql="select Id,StageName,`No`,(select Count(0) from rb_Student where CustomerId=@id and StuStage=a.Id) as ChildCount from rb_stage a where Group_Id=@gid order by `No`";