From cb8e25bd4fb15d39d4b493be36c4e2b11d1ef7bc Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Tue, 16 Dec 2025 09:01:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/PostService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/common/service/PostService.php b/app/common/service/PostService.php index 3c4ca20..542d425 100644 --- a/app/common/service/PostService.php +++ b/app/common/service/PostService.php @@ -70,7 +70,10 @@ class PostService ]; } if (isset($p['keyword']) && $p['keyword']) { - $config['where']['content'] = ['like', '%'.$p['keyword'].'%']; + $k = '%' . $p['keyword'] . '%'; + foreach (['model','content'] as $col) { + $config['orWhere'][] = [$col, 'like', $k]; + } } if (isset($p['status']) && $p['status']) {