From 0364b3b8e5c7ff0828f69ac8ee264b2ac4fca9c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Thu, 20 Jun 2019 10:37:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8D=A3=E8=AA=89=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/rongyu/model/JsRongyuInfo.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/rongyu/model/JsRongyuInfo.php b/application/rongyu/model/JsRongyuInfo.php index cb286216..7d3d4978 100644 --- a/application/rongyu/model/JsRongyuInfo.php +++ b/application/rongyu/model/JsRongyuInfo.php @@ -44,16 +44,18 @@ class JsRongyuInfo extends Base $query->where('rongyuce',$rongyuce); }) ->when(strlen($searchval)>0,function($query) use($searchval){ - $query->whereOr('title|bianhao','like','%'.$searchval.'%') + $query->where(function($z) use($searchval){ + $z->whereOr('title|bianhao','like','%'.$searchval.'%') ->whereOr('id','in',function($q) use($searchval){ $q->name('JsRongyuCanyu') - ->distinct(true) + ->distinct(true) ->where('teacherid','in',function($w) use($searchval){ $w->name('Teacher') ->where('xingming','like','%'.$searchval.'%') ->field('id'); - }) + }) ->field('rongyuid'); + }); }); }) ->with(