我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

我怎样才能在Laravel Eloquent的哪里和哪里做?

This is what I currently have:

$query->orderBy('id', 'DESC')

        ->where('totalColorless', '!=', 0) // currently removes all of these...
        ->where('totalResidual', '!=', 0) // ...and all of these

        ->get();

How can I make it so it removes rows which fulfill both WHERE criteria at the same time?

try with "orWhere":

[...]
->where('totalColorless', '!=', 0)
->orWhere('totalResidual', '!=', 0)
[...]

I think you must put orderBy() before get() and after where()

近期文章

  • Ajax数据功能应该工作但不能
  • PHP数组使用一些操作插入到mysql中
  • outlook与Oracle 11g之间的联系
  • Update_post_meta函数缺少进程
  • 需要帮助基于ui过滤器值创建查询
  • 动态DataTables不使用服务器端处理
  • 以特定间隔将数据从数据库检索到文件中
  • iphone-字符串中替换/”
  • ZendGuardLoader.so:无法打开共享对象文件:没有这样的文件或目录php
  • 如何仅在mPDF中显示图形而不显示表格?
  • jquery mobile listview与php无法正确显示
  • 如何在没有Index.html or.php的情况下将Web应用程序文件运行到服务器?
  • PHP中的Strcmp和字符串比较,其中字符串来自数组
  • Laravel子域路由
  • 重定向太多
  • 指向多边形奇怪的结果
  • 模态弹出窗口不等待Ajax调用
  • WooCommerce检查购物车内容添加到购物车
  • 如何使用PHP在表单中发布html字段数组
  • .htaccess结果不一致

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华