我有疑问where在本机 PHP 中
其中类型 '点'
我尝试转换为雄辩的laravel
->with('payments',function($query){
$query->where('type','<>','point');
})
但它显示错误如下:
mb_strpos() 期望参数 1 为字符串,给定对象
您使用了错误的语法。正确的语法为with() https://laravel.com/docs/5.3/eloquent-relationships#constraining-eager-loads is:
->with(['payments' => function ($query) {
$query->where('type', '<>', 'point');
}])
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)