def get_new_blog_list(self): qry = UserQuery( """ u.loginName, u.userIcon, u.blogName, u.blogIntroduce, u.createDate """ ) qry.subjectId = self.get_subjectId() new_blog_list = qry.query_map(3) request.setAttribute("new_blog_list", new_blog_list)
def get_subject_comissioner(self): qry = UserQuery(""" u.loginName, u.nickName, u.userIcon, u.blogName, u.createDate, u.articleCount, u.resourceCount, u.blogIntroduce """) qry.subjectId = self.subject.subjectId qry.isComissioner = True comissioner_list = qry.query_map(6) request.setAttribute("comissioner_list", comissioner_list)
def query_blog(self): qry = UserQuery( """ u.userId, u.loginName, u.nickName, u.trueName, u.createDate, u.blogName, u.blogIntroduce, u.userIcon, u.myArticleCount, u.otherArticleCount, u.resourceCount, u.commentCount, u.visitCount, u.photoCount,u.articleCount, subj.subjectName, grad.gradeName, grad.gradeId, unit.unitName """ ) qry.userStatus = 0 pager = self.createPager() # 根据页面参数处理. type = self.params.getStringParam("type") if type == "rcmd": qry.userTypeId = 2 elif type == "hot": qry.orderType = 1 else: type = "new" request.setAttribute("type", type) qry.subjectId = self.get_current_subjectId() qry.gradeId = self.get_current_gradeId() qry.k = self.params.getStringParam("k") qry.sysCateId = self.params.getIntParamZeroAsNull("categoryId") #qry.setSubjectCondition(self.subject) qry.sysCateId = self.params.getIntParamZeroAsNull("categoryId") pager.totalRows = qry.count() blog_list = qry.query_map(pager) request.setAttribute("blog_list", blog_list) request.setAttribute("pager", pager) return
def get_famous_user_list(self): qry = UserQuery( """ u.loginName, u.userIcon, u.loginName, u.nickName, subj.subjectId """ ) qry.userTypeId = 1 qry.subjectId = self.get_subjectId() channel_user_list = qry.query_map(3) request.setAttribute("channel_user_list", channel_user_list)
def get_rcmd_blog_list(self): qry = UserQuery( """ u.loginName, u.userIcon, u.blogName, u.createDate, u.blogIntroduce """ ) qry.isRecommend = True qry.subjectId = self.get_subjectId() rcmd_blog_list = qry.query_map(3) request.setAttribute("rcmd_blog_list", rcmd_blog_list)
def get_hot_blog_list(self): qry = UserQuery( """ u.loginName, u.userIcon, u.blogName, u.createDate, u.blogIntroduce """ ) qry.orderType = 1 qry.subjectId = self.get_subjectId() hot_blog_list = qry.query_map(3) request.setAttribute("hot_blog_list", hot_blog_list)
def get_expert_user_list(self): qry = UserQuery(""" u.loginName, u.nickName """) qry.userTypeId = 3 qry.subjectId = self.get_subjectId() expert_user_list = qry.query_map() request.setAttribute("expert_user_list", expert_user_list) # 学科教研员 - 未实现. self.get_subject_comissioner()
def user_list(self, type): # 系统用户管理员可以管理所有用户 pager = self.createPager() qry = UserQuery( """ u.userId, u.loginName, u.nickName, u.trueName, u.userIcon, u.userStatus, u.pushState, u.email, u.subjectId, u.gradeId, u.createDate, u.qq, u.idCard, u.positionId, u.userType, subj.subjectName, grad.gradeName, unit.unitTitle """) qry.userStatus = None qry.userTypeId = self.typeId qry.kk = self.params.getStringParam("k") qry.subjectId = self.params.getIntParamZeroAsNull("subjectId") qry.f = self.params.getStringParam("f") # print("type=" + type) # 根据 type 设置过滤. if type == "unaudit": qry.userStatus = User.USER_STATUS_WAIT_AUTID elif type == "locked": qry.userStatus = User.USER_STATUS_LOCKED elif type == "deleted": qry.userStatus = User.USER_STATUS_DELETED # 普通管理员不能设置 超级管理员的内容 if self.loginUser.loginName != "admin": qry.custormAndWhere = "u.loginName <> 'admin'" pager.totalRows = qry.count() user_list = qry.query_map(pager) request.setAttribute("pager", pager) request.setAttribute("userList", user_list) request.setAttribute("k", qry.kk) request.setAttribute("f", qry.f) request.setAttribute("subjectId", qry.subjectId) request.setAttribute("cmdtype", type) self.putSubjectList() self.putGradeList() #判断是否是中教启星的用户系统,使用了别家公司的用户系统,则部分操作需要限制 #if request.getServletContext().getServletRegistration("CAS-Authentication-Filter") != None: if request.getServletContext().getFilterRegistration( "CAS-Authentication-Filter") != None: request.setAttribute("usermgr3", 1) elif request.getServletContext().getFilterRegistration( "ssoUserFilter") != None: request.setAttribute("usermgr3", 1) else: request.setAttribute("usermgr3", 0) # 不能输入' if qry.kk == "'": self.addActionError(u"请不要输入非法的字符串。") return self.ERROR return ADMIN_USER_LIST
def get_subject_comissioner(self): qry = UserQuery( """ u.loginName, u.nickName, u.userIcon, u.blogName, u.createDate, u.articleCount, u.resourceCount, u.blogIntroduce """) qry.subjectId = self.subject.subjectId qry.isComissioner = True comissioner_list = qry.query_map( 6) # 按照界面 mengv1/subject/jiaoyanyuan.ftl 中获取 13 个. #print "comissioner_list = ", comissioner_list request.setAttribute("comissioner_list", comissioner_list)
def query_blog(self): qry = UserQuery(""" u.userId, u.loginName, u.nickName, u.createDate, u.blogName, u.blogIntroduce, u.userIcon, u.articleCount, u.resourceCount, u.commentCount, u.visitCount, u.photoCount, subj.subjectName, unit.unitName """) qry.subjectId = self.subject.subjectId qry.sysCateId = self.params.getIntParamZeroAsNull("categoryId") qry.k = self.params.getStringParam("k") pager = self.createPager() pager.totalRows = qry.count() blog_list = qry.query_map(pager) request.setAttribute("blog_list", blog_list) request.setAttribute("pager", pager) return