增加文章、商品列表修改排序功能

This commit is contained in:
2021-01-11 00:21:24 +08:00
parent ce7b525f1a
commit 269fd4a6fe
8 changed files with 183 additions and 26 deletions
@@ -691,6 +691,26 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
}
#endregion
#region 修改文章排序
[HttpPost]
[MyAuthorize("edit", "article", "JSON")]
public IActionResult DoEditArticleSequence(int id, int rank)
{
Article entity = Article.Find(Article._.Id == id);
if (entity == null)
{
tip.Message = "系统找不到本记录";
return Json(tip);
}
entity.Sequence = rank;
entity.Update();
Admin.WriteLogActions($"修改文章排序(id:{id},排序:{rank});");
tip.Message = "修改排序成功!";
tip.Status = JsonTip.SUCCESS;
return Json(tip);
}
#endregion
#region 迁移文章
[HttpGet]
[MyAuthorize("batch", "article")]
@@ -290,6 +290,26 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
}
#endregion
#region 修改商品排序
[HttpPost]
[MyAuthorize("edit", "product", "JSON")]
public IActionResult DoEditProductSequence(int id, int rank)
{
Product entity = Product.Find(Product._.Id == id);
if (entity == null)
{
tip.Message = "系统找不到本记录";
return Json(tip);
}
entity.Sequence = rank;
entity.Update();
Admin.WriteLogActions($"修改商品排序(id:{id},排序:{rank});");
tip.Message = "修改排序成功!";
tip.Status = JsonTip.SUCCESS;
return Json(tip);
}
#endregion
#region 添加商品
[HttpGet]
[MyAuthorize("add", "product")]