public CommentsAuditList GetPendingAuditList(int pageIndex = 1, int pageSize = 10, string openId = "") { CommentsAuditList result = new CommentsAuditList(); List <CommentsEx> comments = new List <CommentsEx>(); try { var dao = new CommentsDao(mysqlConnection); StringBuilder sb = new StringBuilder(); if (!string.IsNullOrEmpty(openId)) { sb.Append($" comment_user_id='{openId}'"); } comments = dao.GetAuditList(0, pageIndex, pageSize, sb.ToString()); Int64 count = dao.GetAuditListCount(0); result.lists = comments; result.count = count; } catch (Exception ex) { logger.Error("获取评论失败", ex); } return(result); }
public Int64 GetPendingAuditCount() { try { var dao = new CommentsDao(mysqlConnection); Int64 count = dao.GetAuditListCount(0); return(count); } catch (Exception ex) { logger.Error("获取评论失败", ex); } return(0); }
public CommentsAuditList GetRejectedAuditList(int pageIndex = 1, int pageSize = 10) { CommentsAuditList result = new CommentsAuditList(); List <CommentsEx> comments = new List <CommentsEx>(); try { var dao = new CommentsDao(mysqlConnection); comments = dao.GetAuditList(2, pageIndex, pageSize); Int64 count = dao.GetAuditListCount(2); result.lists = comments; result.count = count; } catch (Exception ex) { logger.Error("获取评论失败", ex); } return(result); }