diff --git a/application/wechat/controller/News.php b/application/wechat/controller/News.php index 89af09313..bad07bb39 100644 --- a/application/wechat/controller/News.php +++ b/application/wechat/controller/News.php @@ -109,7 +109,7 @@ class News extends BasicAdmin { foreach ($data as &$vo) { $vo['create_by'] = session('user.id'); $vo['create_at'] = date('Y-m-d H:i:s'); - $vo['digest'] = empty($vo['digest']) ? mb_substr(strip_tags($vo['content']), 0, 120) : $vo['digest']; + $vo['digest'] = empty($vo['digest']) ? mb_substr(strip_tags(str_replace(["\s", ' '], '', $vo['content'])), 0, 120) : $vo['digest']; if (empty($vo['id'])) { $result = $id = Db::name('WechatNewsArticle')->insertGetId($vo); } else { diff --git a/application/wechat/view/news.form.html b/application/wechat/view/news.form.html index d1feff639..59ea1e26e 100644 --- a/application/wechat/view/news.form.html +++ b/application/wechat/view/news.form.html @@ -83,7 +83,7 @@