diff --git a/application/admin/controller/wechat/WechatNewsCategory.php b/application/admin/controller/wechat/WechatNewsCategory.php index b2ab8bec..f97e07a5 100644 --- a/application/admin/controller/wechat/WechatNewsCategory.php +++ b/application/admin/controller/wechat/WechatNewsCategory.php @@ -235,6 +235,8 @@ class WechatNewsCategory extends AuthController if($v['author'] == '') return JsonService::fail('作者不能为空'); if($v['content'] == '') return JsonService::fail('正文不能为空'); if($v['synopsis'] == '') return JsonService::fail('摘要不能为空'); + $v['add_time'] = time(); + $v['status'] = 1; if($v['id']){ $idC = $v['id']; unset($v['id']); diff --git a/application/wap/controller/Article.php b/application/wap/controller/Article.php index 1f8147fa..0f87472e 100644 --- a/application/wap/controller/Article.php +++ b/application/wap/controller/Article.php @@ -38,6 +38,7 @@ class Article extends WapBasic { public function visit($id = '') { $content = ArticleModel::where('status',1)->where('hide',0)->where('id',$id)->order('id desc')->find(); + if(!$content || !$content["status"]) return $this->failed('此文章已经不存在!'); $content["content"] = Db::name('articleContent')->where('nid',$content["id"])->value('content'); //增加浏览次数 diff --git a/application/wap/view/first/index/index.html b/application/wap/view/first/index/index.html index f5ff8b33..65d168db 100644 --- a/application/wap/view/first/index/index.html +++ b/application/wap/view/first/index/index.html @@ -155,7 +155,8 @@ -