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(