修复cookies删除不成功;修复后台批量操作因更新boottable后无法获取选中id

This commit is contained in:
2020-10-23 14:46:40 +08:00
parent ab40520cda
commit 3b50120a5c
10 changed files with 60 additions and 16 deletions
+30
View File
@@ -228,6 +228,36 @@ namespace COMCMS.Core
else
return null;
}
/// <summary>
/// 获取前几条文章
/// </summary>
/// <param name="kid">栏目id</param>
/// <param name="records">条数</param>
/// <returns></returns>
public static IList<Article> FindTopList(int kid, int records, bool isShowSub = false)
{
if (!isShowSub)
return FindAll(_.KId == kid & _.IsHide == 0, _.Id.Desc(), null, 0, records);
else
{
Expression ex = _.IsHide == 0;
List<int> kids = new List<int>();
kids.Add(kid);
IList<ArticleCategory> subkinds = ArticleCategory.FindByParentID(kid);
if (subkinds != null && subkinds.Count > 0)
{
foreach (var item in subkinds)
{
kids.Add(item.Id);
}
}
ex &= Article._.KId.In(kids);
return FindAll(ex, _.Id.Desc(), null, 0, records);
}
}
#endregion
}
}
+2 -1
View File
@@ -8,6 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Xml.Serialization;
using COMCMS.Common;
using NewLife;
using NewLife.Data;
using NewLife.Log;
@@ -359,7 +360,7 @@ namespace COMCMS.Core
}
else
{
re += " &gt; " + string.Format(tpl, "/article/index/" + model.Id, model.KindName);
re += " &gt; " + string.Format(tpl, ViewsHelper.EchoURL(Utils.CMSType.ArticleCategory, kid), model.KindName);
if (model.PId != 0)
{
re = GetNav(model.PId) + re;