From 2c87dfa5ccbe73042bfe1522cfb3972e01f97c33 Mon Sep 17 00:00:00 2001 From: Alone <675061370@qq.com> Date: Wed, 27 Nov 2024 11:06:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E5=88=AB=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=9B=A0=E6=A0=87=E9=A2=98=E7=89=B9=E6=AE=8A=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/model/Source.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/model/Source.php b/app/model/Source.php index 0bf21f4..e935f46 100644 --- a/app/model/Source.php +++ b/app/model/Source.php @@ -68,6 +68,10 @@ class Source extends QfShop if(!is_null($result)){ $result->inc('page_views')->update(); $result['times'] = substr($result['time'], 0, 10); + + $string = trim($result['title']); // 去除前后空格 + $string = str_replace("'", "", $string); // 去除所有单引号 + $result['title'] = $string; } unset($result['time']); return $result; @@ -215,6 +219,11 @@ class Source extends QfShop $item['name'] = highlightKeywords($item['title'], $searchTitle); $item['times'] = substr($item['time'], 0, 10); unset($item['time']); + + $string = trim($item['title']); // 去除前后空格 + $string = str_replace("'", "", $string); // 去除所有单引号 + $item['title'] = $string; + return $item; }) ->toArray();