Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel 雄辩的倍数,其中具有较高和较低的相同值_Laravel_Laravel 5_Eloquent - Fatal编程技术网

Laravel 雄辩的倍数,其中具有较高和较低的相同值

Laravel 雄辩的倍数,其中具有较高和较低的相同值,laravel,laravel-5,eloquent,Laravel,Laravel 5,Eloquent,我无法获得以下雄辩查询的结果: return Cost::where('zipcode_start', '>=', 8000) ->where('zipcode_end', '<=', 8000) ->pluck('price); 返回 成本::其中('zipcode_start','>=',8000) ->我认为你的比较应该改变立场 Cost::where([ ['zipcode_start, '<=', 8000], ['zipc

我无法获得以下雄辩查询的结果:

return 
  Cost::where('zipcode_start', '>=', 8000)
  ->where('zipcode_end', '<=', 8000)
  ->pluck('price);
返回
成本::其中('zipcode_start','>=',8000)

->我认为你的比较应该改变立场

Cost::where([
    ['zipcode_start, '<=', 8000],
    ['zipcode_end', '>=', 8000]
])
->pluck('price');
Cost::where([
['zipcode_start',=',8000]
])
->拔毛(价格);

你找不到任何数据,因为你做错了。你能用一个例子说更多吗我认为比较是错误的。如果你使用whereRaw,它能工作吗?查询没有问题。你能验证它是否真的有该条件的数据吗?什么类型的列是
zipcode\u start
?不会改变A=8000的任何内容我的答案是,如果我的答案没有明确指出,请帮助改进。好吧,我打赌,但这仍然没有意义……或者他的表列有点乱;)@Paolo_Mulder这是有意义的;-)这就是解决办法