Drupal 视图过滤器中的 SQL 函数
我正在创建一个将在块中显示的视图。被拉入视图的每个节点都有一个与其关联的时间值(这实际上是 0 到 2399 之间的整数,因为 Drupal 不支持仅时间值)。作为视图中的过滤器,我只想显示当天尚未发生的事件。所以我想要 eventtime >过滤器中的 CURTIME()。然而,Drupal 似乎正在剥离 MySQL 功能并将其变成 0。有没有办法让我不去管它?
I'm creating a View that will be shown within a Block. Each Node being pulled into the View has a time value associated to it (this is actually an integer between 0 and 2399 as Drupal doesn't support time only values). As a filter in the View I only want to show events that have yet to happen on that day. So i want the eventtime > CURTIME() in the filter. However Drupal seems to be stripping out the MySQL function and turning it into 0. Is there a way I can get it to leave it alone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果这与您有关事件和事件的问题有关;重复日期,我认为重复您选择的每日活动可能比这更好,但无论如何。
要在过滤器中维护自定义 SQL,您可以谨慎使用(以及一些 PHP 技能):
http://drupal.org /project/viewsphpfilter
以下是一些使用示例:
http://drupal.org/node/690670< /a>
If this is related to your question about events & repeating dates, I think a daily event that repeats how you choose might be better than this but whatever.
To maintain custom SQL in a filter you could use this with caution (and some PHP skill):
http://drupal.org/project/viewsphpfilter
Here are some some usage examples:
http://drupal.org/node/690670