gpt4 book ai didi

php - 紧凑(): Undefined variable: operator

转载 作者:行者123 更新时间:2023-12-04 06:32:08 27 4
gpt4 key购买 nike

我收到以下错误

  (1/1) ErrorException
compact(): Undefined variable: operator

这是我的代码行
$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);


为什么会这样?是因为我的 PHP 版本 (7.3) 还是其他原因?

最佳答案

转到您的项目

vendor\laravel\framework\src\Illuminate\Database\Query\Builder.php
在第 1337 行,您可以在 addWhereExistsQuery 中找到以下代码方法
$this->wheres[] = compact('type', 'operator', 'query', 'boolean');
您只需删除 'operator' 参数。
我希望它能正常工作。

关于php - 紧凑(): Undefined variable: operator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56726263/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com