From edb63cb37931fba4466bffa67c2aa91feaa7452b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=BF=97?= Date: Tue, 6 Jan 2026 14:09:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/MatchService.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/service/MatchService.php b/app/service/MatchService.php index 5c31fcd..26b69b9 100644 --- a/app/service/MatchService.php +++ b/app/service/MatchService.php @@ -201,9 +201,10 @@ class MatchService $q->where('education_require', 'like', '%本科%') ->where('education_require', 'like', '%硕士%', 'or') ->where('education_require', 'like', '%博士%', 'or') - ->where('education_require', '=', '', 'or') - ->whereRaw('education_require IS NULL', [], 'or'); + ->where('education_require', '=', '', 'or'); }); + // NULL 值检查使用 whereRaw,单独添加 + $query->whereRaw('(education_require IS NULL OR education_require = \'\')', [], 'or'); } } @@ -216,9 +217,10 @@ class MatchService $query->where(function($q) use ($resume) { $q->where('sex_require', '不限制') ->where('sex_require', $resume['gender'], 'or') - ->where('sex_require', '', 'or') - ->whereRaw('sex_require IS NULL', [], 'or'); + ->where('sex_require', '', 'or'); }); + // NULL 值检查使用 whereRaw,单独添加 + $query->whereRaw('(sex_require IS NULL OR sex_require = \'\')', [], 'or'); } // 获取过滤后的岗位