如何使用 OR 表达式更新 Drupal Views 2 查询?

发布于 2024-09-27 03:37:05 字数 413 浏览 0 评论 0原文

我想通过以下方式向 Drupal 6.x Views 2 查询添加 OR 表达式:

现有查询:

SELECT node.nid AS nid FROM node node WHERE (expr1) AND (expr2)

新查询 - 这就是我想要实现的目标:

SELECT node.nid AS nid FROM node node WHERE (expr1) AND (expr2 OR new_expr)

问题是如何更新我现有的查询(使用 Views 2 构建) UI)与views_query_alter或其他一些钩子以获得expr2new_exprOR'ed?

I'd like to add an OR expression to Drupal 6.x Views 2 query in the following way:

Existing query:

SELECT node.nid AS nid FROM node node WHERE (expr1) AND (expr2)

New query - this is what I want to achieve:

SELECT node.nid AS nid FROM node node WHERE (expr1) AND (expr2 OR new_expr)

The question is how to update my existing query (build with Views 2 UI) with views_query_alter or some other hook in order to get expr2 OR'ed with new_expr?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

燃情 2024-10-04 03:37:05

Views Or - 开发版本,但它可以工作。

Views Or - dev version, but it's work.

毁梦 2024-10-04 03:37:05

您还可以使用 Views 版本 3.0(目前处于 alpha3 版本,非常稳定)http://ftp.drupal.org/files/projects/views-6.x-3.0-alpha3.tar.gz

它支持视图过滤器的ORing盒子的。

You can also use Views Version 3.0 (currently in alpha3 so quite stable) http://ftp.drupal.org/files/projects/views-6.x-3.0-alpha3.tar.gz

It supports ORing of views filters out of the box.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文