|
|
@@ -51,12 +51,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 弹窗消息列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(MsgAlert data, string MsgTypeSelect, string PushTypeSelect, string PushFlagSelect, int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexData(MsgAlert data, string MsgTypeSelect, string PushTypeSelect, string PushFlagSelect, string CreateDateData, int page = 1, int limit = 30)
|
|
|
{
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
|
|
|
- Fields.Add("CreateDate", "3"); //时间
|
|
|
+ // Fields.Add("CreateDate", "3"); //时间
|
|
|
Fields.Add("Title", "1"); //标题
|
|
|
|
|
|
|
|
|
@@ -76,6 +76,14 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
condition += " and PushFlag=" + PushFlagSelect;
|
|
|
}
|
|
|
+ //创建时间
|
|
|
+ if(!string.IsNullOrEmpty(CreateDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
|
|
|
|
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MsgAlert", Fields, "Id desc", "0", page, limit, condition);
|
|
|
@@ -86,6 +94,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int MsgType = int.Parse(dic["MsgType"].ToString());
|
|
|
if (MsgType == 1) dic["MsgType"] = "文本";
|
|
|
if (MsgType == 2) dic["MsgType"] = "图片";
|
|
|
+ if (MsgType == 3) dic["MsgType"] = "动图";
|
|
|
if (MsgType == 0) dic["MsgType"] = "";
|
|
|
dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
|
|
|
//推送类型
|
|
|
@@ -136,6 +145,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
|
|
|
Fields.Add("MsgType", data.MsgType); //消息类型
|
|
|
+ Fields.Add("Status", 1); //默认开启
|
|
|
Fields.Add("Title", data.Title); //标题
|
|
|
Fields.Add("Summary", data.Summary); //简介
|
|
|
Fields.Add("Content", data.Content); //内容
|
|
|
@@ -155,9 +165,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("IsWeekend", data.IsWeekend); //是否周末
|
|
|
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
- Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
+ Fields.Add("SeoKeyword", DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8));
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
- int Id = new AdminContentOther(_accessor.HttpContext, SystemPublicFuction.dbtables).Add("MsgAlert", Fields, 0);
|
|
|
+ int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("MsgAlert", Fields, 0);
|
|
|
AddSysLog(data.Id.ToString(), "MsgAlert", "add");
|
|
|
db.SaveChanges();
|
|
|
|
|
|
@@ -216,9 +226,8 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("IsWeekend", data.IsWeekend); //是否周末
|
|
|
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
- Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
- new AdminContentOther(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("MsgAlert", Fields, data.Id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MsgAlert", Fields, data.Id);
|
|
|
AddSysLog(data.Id.ToString(), "MsgAlert", "update");
|
|
|
db.SaveChanges();
|
|
|
|
|
|
@@ -242,7 +251,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", -1);
|
|
|
- new AdminContentOther(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("MsgAlert", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MsgAlert", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
|
|
|
@@ -266,7 +275,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", 1);
|
|
|
- new AdminContentOther(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("MsgAlert", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MsgAlert", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -289,7 +298,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", 0);
|
|
|
- new AdminContentOther(_accessor.HttpContext, SystemPublicFuction.dbtables).Edit("MsgAlert", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MsgAlert", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -304,7 +313,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// <param name="Id"></param>
|
|
|
public string Sort(int Id, int Sort)
|
|
|
{
|
|
|
- new AdminContentOther(_accessor.HttpContext, SystemPublicFuction.dbtables).Sort("MsgAlert", Sort, Id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("MsgAlert", Sort, Id);
|
|
|
|
|
|
AddSysLog(Id.ToString(), "MsgAlert", "sort");
|
|
|
return "success";
|
|
|
@@ -368,7 +377,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
|
|
|
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, SystemPublicFuction.dbtables).IndexData("MsgAlert", Fields, "Id desc", "0", 1, 20000, condition, "", false);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MsgAlert", Fields, "Id desc", "0", 1, 20000, condition, "", false);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|