/// <summary> /// 清空指定用户的消息 /// </summary> /// <param name="userId"></param> /// <returns></returns> public int ClearAlerts(int userId) { int alertTimeId = SiteManager.Catalog.GetExtByName(ScheduleEvent.Root.Id, ScheduleEvent.Root.AlertTime).Id; var query = _article.GetAllAtCatalog(ScheduleEvent.Root.Id) .Where(ca => ca.Article.Options == ScheduleEvent.OptionNotice && ca.Article.EditorId == userId); return(query.Delete()); }
private IQueryable <Base_CatalogArticle> GetUserQueryArticle(string modelName) { int userId = CommOp.ToInt(AppManager.Instance.GetCurrentUserId()); int modelNameId = SiteManager.Catalog.GetExtByName(AdvQuery.Query.Id, AdvQuery.Query.ModelName).Id; var arts = _article.GetAllAtCatalog(AdvQuery.Query.Id) .Where(ca => ca.Article.EditorId == userId && ca.Article.Exts.Any(ext => ext.CatlogExtId == modelNameId && ext.Value == modelName)); return(arts); }