我收到以下错误
(1/1) ErrorException
compact(): Undefined variable: operator
Run Code Online (Sandbox Code Playgroud)
这是我的代码行
$postsCat = Post::whereHas('Cat', function($query) use ($sreachWord) {
return $query->whereRaw('name REGEXP"'.sql_text_to_regx($sreachWord).'"');
})->orderBy('top','desc')
->orderBy('updated_at','desc')
->paginate(30);
Run Code Online (Sandbox Code Playgroud)
为什么会这样?是因为我的 PHP 版本 (7.3) 还是其他原因?
小智 38
转到您的项目
vendor\laravel\framework\src\Illuminate\Database\Query\Builder.php
Run Code Online (Sandbox Code Playgroud)
在第 1337 行,您可以在addWhereExistsQuery方法中找到以下代码
$this->wheres[] = compact('type', 'operator', 'query', 'boolean');
Run Code Online (Sandbox Code Playgroud)
您只需删除 'operator' 参数。
我希望它能正常工作。
| 归档时间: |
|
| 查看次数: |
33953 次 |
| 最近记录: |