|
|
@@ -51,7 +51,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 商学院每日晨会列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(SchoolMorningMeet data, int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexData(SchoolMorningMeet data, string IsBannerSelect, int page = 1, int limit = 30)
|
|
|
{
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
@@ -62,6 +62,10 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
|
|
|
string condition = " and Status>-1";
|
|
|
+ if (!string.IsNullOrEmpty(IsBannerSelect))
|
|
|
+ {
|
|
|
+ condition += " and IsBanner=" + IsBannerSelect;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("SchoolMorningMeet", Fields, "Id desc", "0", page, limit, condition);
|
|
|
@@ -69,6 +73,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
|
|
|
+ dic["IsBannerName"] = dic["IsBanner"].ToString() == "1" ? "是" : "否";
|
|
|
|
|
|
}
|
|
|
return Json(obj);
|
|
|
@@ -114,14 +119,16 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
+ Fields.Add("IsBanner", data.IsBanner); //首页每日晨会推荐
|
|
|
+ Fields.Add("BannerPhoto", data.BannerPhoto); //每日晨会Banner
|
|
|
int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("SchoolMorningMeet", Fields, 0);
|
|
|
AddSysLog(data.Id.ToString(), "SchoolMorningMeet", "add");
|
|
|
db.SaveChanges();
|
|
|
- var info = db.SchoolMorningMeet.FirstOrDefault(m => m.Id == Id);
|
|
|
- if(info != null)
|
|
|
+ var info = db.SchoolMorningMeet.FirstOrDefault(m => m.Id == Id);
|
|
|
+ if (info != null)
|
|
|
{
|
|
|
- info.Sort = function.ConvertDateTimeInt(data.CreateDate.Value)/60;
|
|
|
- info.QueryCount = function.ConvertDateTimeInt(data.UpdateDate.Value)/60;
|
|
|
+ info.Sort = function.ConvertDateTimeInt(data.CreateDate.Value) / 60;
|
|
|
+ info.QueryCount = function.ConvertDateTimeInt(data.UpdateDate.Value) / 60;
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
@@ -170,13 +177,15 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
+ Fields.Add("IsBanner", data.IsBanner); //首页每日晨会推荐
|
|
|
+ Fields.Add("BannerPhoto", data.BannerPhoto); //每日晨会Banner
|
|
|
new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("SchoolMorningMeet", Fields, data.Id);
|
|
|
AddSysLog(data.Id.ToString(), "SchoolMorningMeet", "update");
|
|
|
- var info = db.SchoolMorningMeet.FirstOrDefault(m => m.Id == data.Id);
|
|
|
- if(info != null)
|
|
|
+ var info = db.SchoolMorningMeet.FirstOrDefault(m => m.Id == data.Id);
|
|
|
+ if (info != null)
|
|
|
{
|
|
|
- info.Sort = function.ConvertDateTimeInt(data.CreateDate.Value)/60;
|
|
|
- info.QueryCount = function.ConvertDateTimeInt(data.UpdateDate.Value)/60;
|
|
|
+ info.Sort = function.ConvertDateTimeInt(data.CreateDate.Value) / 60;
|
|
|
+ info.QueryCount = function.ConvertDateTimeInt(data.UpdateDate.Value) / 60;
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
|