[更新]修改微信图文摘要处理

This commit is contained in:
Anyon 2017-05-12 17:32:20 +08:00
parent f6e74cc7b7
commit 1ec81ef2df
2 changed files with 2 additions and 2 deletions

View File

@ -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 {

View File

@ -83,7 +83,7 @@
<div class="form-group">
<div class="col-md-12">
<label style="color:#aaa">摘要选填如果不填写会默认抓取正文前54个字</label>
<textarea name="digest" class="layui-input" style="height:80px;resize:none;"></textarea>
<textarea name="digest" class="layui-input" style="height:80px;resize:none;line-height:20px"></textarea>
</div>
</div>
<div class="form-group">