|
|
@@ -32,11 +32,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 根据条件查询广告位列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public IActionResult Index(Advertisment data, string right)
|
|
|
+ public IActionResult Index(Advertisment data, string right, string CurColId)
|
|
|
{
|
|
|
ViewBag.RightInfo = RightInfo;
|
|
|
ViewBag.right = right;
|
|
|
ViewBag.SysUserName = SysUserName;
|
|
|
+ ViewBag.CurColId = CurColId;
|
|
|
|
|
|
string Condition = "";
|
|
|
Condition += "Title:\"" + data.Title + "\",";
|
|
|
@@ -58,13 +59,15 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 广告位列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(Advertisment data, int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexData(Advertisment data, string CurColId, int page = 1, int limit = 30)
|
|
|
{
|
|
|
- Dictionary<string, string> ColDic = new DictionaryClass().getColDic("003");
|
|
|
+ Dictionary<string, string> ColDic = new DictionaryClass().getColDic(CurColId);
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
Fields.Add("Title", "2"); //标题
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).IndexData("Advertisment", Fields, "Id desc", "False", page, limit);
|
|
|
+ string condition = " and ColId like '" + CurColId + "%'";
|
|
|
+ // Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).IndexData("Advertisment", Fields, "Id desc", "False", page, limit);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).IndexData("Advertisment", Fields, "Id desc", "False", page, limit, condition);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
@@ -81,11 +84,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 增加或修改广告位信息
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public IActionResult Add()
|
|
|
+ public IActionResult Add(string right, string CurColId)
|
|
|
{
|
|
|
ViewBag.RightInfo = RightInfo;
|
|
|
ViewBag.right = _accessor.HttpContext.Request.Query["right"];
|
|
|
ViewBag.SysUserName = SysUserName;
|
|
|
+ ViewBag.CurColId = CurColId;
|
|
|
|
|
|
return View();
|
|
|
}
|
|
|
@@ -99,7 +103,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public string Add(Advertisment data)
|
|
|
+ public string Add(Advertisment data, string CurColId = "")
|
|
|
{
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Title", data.Title); //标题
|
|
|
@@ -127,11 +131,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 增加或修改广告位信息
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public IActionResult Edit(int Id = 0)
|
|
|
+ public IActionResult Edit(string right, string CurColId, int Id = 0)
|
|
|
{
|
|
|
ViewBag.RightInfo = RightInfo;
|
|
|
ViewBag.right = _accessor.HttpContext.Request.Query["right"];
|
|
|
ViewBag.SysUserName = SysUserName;
|
|
|
+ ViewBag.CurColId = CurColId;
|
|
|
|
|
|
Advertisment editData = bsdb.Advertisment.FirstOrDefault(m => m.Id == Id) ?? new Advertisment();
|
|
|
ViewBag.data = editData;
|
|
|
@@ -147,7 +152,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public string Edit(Advertisment data)
|
|
|
+ public string Edit(Advertisment data, string CurColId = "")
|
|
|
{
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Title", data.Title); //标题
|
|
|
@@ -183,7 +188,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
string ColId = "";
|
|
|
Advertisment ad = bsdb.Advertisment.FirstOrDefault(m => m.Id == id);
|
|
|
- if(ad != null)
|
|
|
+ if (ad != null)
|
|
|
{
|
|
|
ColId = ad.ColId;
|
|
|
}
|
|
|
@@ -254,7 +259,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
AddSysLog(Id.ToString(), "Advertisment", "sort");
|
|
|
Advertisment ad = bsdb.Advertisment.FirstOrDefault(m => m.Id == Id);
|
|
|
- if(ad != null)
|
|
|
+ if (ad != null)
|
|
|
{
|
|
|
SetRedis(ad.ColId);
|
|
|
}
|