Просмотр исходного кода

推送文章提示文章不存在

sugar1569 7 лет назад
Родитель
Сommit
d7518f10e0

+ 2 - 0
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']);

+ 1 - 0
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');
         //增加浏览次数

+ 2 - 1
application/wap/view/first/index/index.html

@@ -155,7 +155,8 @@
     </div>
     <span class="nickname"></span>
 </div>
-<div class="lottie-bg"><div id="lottie"></div></div><script>
+<div class="lottie-bg"><div id="lottie"></div></div>
+<script>
     var anim;
     var elem = document.getElementById('lottie');
     //elem.style.display = 'none';