脚本宝典收集整理的这篇文章主要介绍了php – 在eloquent模型中围绕id的引号在生产站点上是必需的,但不适用于localhost,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
生产
‘发票’=> Auth :: user() – > invoices-> where(‘paid’,“0”)
本地主机
‘发票’=> Auth :: user() – > invoices-> where(‘paid’,0)
这真的很奇怪,每当我从github部署时,我都非常想进入并改变它.这是一个常见的问题吗?我似乎找不到任何关于它的东西.
我将列出一些Laravel查询日志:
在int周围进行本地安装(不工作)
Array ( [0] => Array ( [query] => select * From `users` where `users`.`id` = ? limIT 1 [bindings] => Array ( [0] => 1 ) [time] => 10.49 ) [1] => Array ( [query] => select * from `invoices` where `invoices`.`user_id` = ? and `invoices`.`user_id` is not null [bindings] => Array ( [0] => 1 ) [time] => 1.39 ) )
在int(工作)周围没有引用的本地安装
Array ( [0] => Array ( [query] => select * from `users` where `users`.`id` = ? limit 1 [bindings] => Array ( [0] => 1 ) [time] => 0.84 ) [1] => Array ( [query] => select * from `invoices` where `invoices`.`user_id` = ? and `invoices`.`user_id` is not null [bindings] => Array ( [0] => 1 ) [time] => 1.15 ) )
生产安装没有引用int(不工作)
Array ( [0] => Array ( [query] => select * from `users` where `users`.`id` = ? limit 1 [bindings] => Array ( [0] => 1 ) [time] => 2.3 ) [1] => Array ( [query] => select * from `invoices` where `invoices`.`user_id` = ? and `invoices`.`user_id` is not null [bindings] => Array ( [0] => 1 ) [time] => 0.67 ) )
围绕int(工作)报价的生产安装
Array ( [0] => Array ( [query] => select * from `users` where `users`.`id` = ? limit 1 [bindings] => Array ( [0] => 1 ) [time] => 0.88 ) [1] => Array ( [query] => select * from `invoices` where `invoices`.`user_id` = ? and `invoices`.`user_id` is not null [bindings] => Array ( [0] => 1 ) [time] => 0.81 ) )
解:
以上是脚本宝典为你收集整理的php – 在eloquent模型中围绕id的引号在生产站点上是必需的,但不适用于localhost全部内容,希望文章能够帮你解决php – 在eloquent模型中围绕id的引号在生产站点上是必需的,但不适用于localhost所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。