Heim > Fragen und Antworten > Hauptteil
P粉2183619722023-09-06 11:48:46
我已经通过以下方式完成了它:
$searchstring = '(victim OR suspect) AND crime NOT covid'; $searchstring = str_replace(" OR ", ' ', $searchstring); $searchstring = str_replace(" AND ", ' +', $searchstring); $searchstring = str_replace(" NOT ", ' -', $searchstring); $searchstring = '+'.$searchstring; $searchresult = RssItem::whereRaw("MATCH (description) AGAINST ('$searchstring' IN BOOLEAN MODE)")->get();
但也许有更好的方法? :-)