We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在全局定义了查询范围 protected $globalScope = ['is_delete'];
public function scopeIs_Delete($query): void { $query->where('is_delete',0); }
正常使用Model::withoutGlobalScope()可以关闭这个范围
但是在闭包里面join查询时候没有办法调用这个静态方法,还是会报字段重复的错误 SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'is_delete' in where clause is ambiguous
请问有解决办法吗
The text was updated successfully, but these errors were encountered:
public function scopeIs_Delete($query): void { $query->where('__TABLE__.is_delete', 0); }
修改成这样看看行不行。
Sorry, something went wrong.
No branches or pull requests
在全局定义了查询范围
protected $globalScope = ['is_delete'];
正常使用Model::withoutGlobalScope()可以关闭这个范围
但是在闭包里面join查询时候没有办法调用这个静态方法,还是会报字段重复的错误
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'is_delete' in where clause is ambiguous
请问有解决办法吗
The text was updated successfully, but these errors were encountered: