【问题标题】:How to select last 24 hours Doctrine_Query with Symfony?如何使用 Symfony 选择过去 24 小时的 Doctrine_Query?
【发布时间】:2011-06-20 12:49:11
【问题描述】:

我正在尝试获取昨天登录的所有用户。我该怎么做?

在 yml 中,用户表是可时间戳的。

我在 Symfony 1.4 中使用 Doctrine 1.2。

Users:
  tableName:          users
  options:
    type:             InnoDB
    collate:          utf8_general_ci
    charset:          utf8
  actAs:
    Timestampable:
      updated:
        disabled: true

【问题讨论】:

  • 你有表定义吗?

标签: mysql sql symfony1 doctrine


【解决方案1】:

您不能,除非您添加一个字段,以便在每次有人登录时更新记录。时间戳为您提供“created_at”(记录创建)和“updated_at”(记录最后更新)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-26
    • 1970-01-01
    • 2023-03-10
    • 2020-09-06
    相关资源
    最近更新 更多