Doctrine 总是在查询中包含一个 ID 列,例如:
$new_fees = Doctrine::getTable('Stats')->createQuery('s')
->select('s.sid')->where('s.uid = ?', $this->uid)
->andWhere('s.operation = ?', PPOperationType::FEE_PAID_BY_REFERRED_OWNER)
->andWhere('s.created_at > ?', $lastwd)
->groupBy('s.sid')->execute();
不起作用,因为 s.id 包括在内(我没有要求教义)。如何摆脱该 id 列?必须在这里使用原始 SQL 会扼杀教义的用处。