From cfc195e83e3d142197dfb9a771286f63427a106a Mon Sep 17 00:00:00 2001 From: chenqi Date: Sun, 23 Dec 2018 21:19:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dgit=20hub=E4=B8=AD=E9=97=AE?= =?UTF-8?q?=E9=A2=982-6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- COMCMS.Core/Core/广告详情.Biz.cs | 2 +- COMCMS.Web/Views/Home/Index.cshtml | 375 ++++++++++++++------------- 2 files changed, 196 insertions(+), 181 deletions(-) diff --git a/COMCMS.Core/Core/广告详情.Biz.cs b/COMCMS.Core/Core/广告详情.Biz.cs index 940ec37..a1649cf 100644 --- a/COMCMS.Core/Core/广告详情.Biz.cs +++ b/COMCMS.Core/Core/广告详情.Biz.cs @@ -305,7 +305,7 @@ namespace COMCMS.Core { Ads model = new Ads(); model = Find(_.Id == aid); - if (model.TId == 4) + if (model!=null && model.TId == 4) { List listimg = new List(); listimg = JsonConvert.DeserializeObject>(model.Content); diff --git a/COMCMS.Web/Views/Home/Index.cshtml b/COMCMS.Web/Views/Home/Index.cshtml index d92ab5b..709e806 100644 --- a/COMCMS.Web/Views/Home/Index.cshtml +++ b/COMCMS.Web/Views/Home/Index.cshtml @@ -6,7 +6,6 @@ ViewBag.description = cfg.Description; Article about = ViewBag.about; - IList listLinks = Link.FindAll(Link._.KId == 1, Link._.Sequence.Asc(), null, 0, 0); //处理bannr广告 @@ -18,11 +17,16 @@ @@ -266,13 +280,14 @@
- @{ - IList
listNews1 = Article.FindAll(Article._.KId == 6, Article._.Sequence.Asc(), null, 0, 4); - } -
- - @if (listNews1.Count > 0) - { + @{ + IList
listNews1 = Article.FindAll(Article._.KId == 6, Article._.Sequence.Asc(), null, 0, + 4); + } +
+ + @if (listNews1.Count > 0) + { - } - + } + +
+ -
- - @{ - IList
listNews2 = Article.FindAll(Article._.KId == 7, Article._.Sequence.Asc(), null, 0, 4); - } - @if (listNews2.Count > 0) - { - - } - - -
+ } +
+
@@ -431,17 +445,17 @@
@foreach (var l in listLinks) { -
- -
+
+ +
} - +
@@ -451,26 +465,27 @@