我试图在推进中获得列的总和。我的代码
$c = new Criteria();
$c->add(valuePeer::OWNER_ID, $this->getId());
$c->addSelectColumn('SUM(' . valuePeer::VALUE . ') as total');
$c->addGroupByColumn(valuePeer::VALUE);
$sum = valuePeer::DoSelect($c);
打印出来$sum
什么都不返回(甚至没有空对象)。我得到的只是Notice: Undefined offset: 1 in /.../lib/model/om/BaseValue.php on line 203 Notice: Undefined offset: 2 in /.../lib/model/om/BaseValue.php on line 204
我按照这里::DoSelectRS($c)
的建议和其他多个讨论尝试了这种方法,但我得到了一个错误:。Fatal error: Call to undefined method ValuePeer::DoSelectRS() in /.../lib/model/Restauracia.php on line 39
谁能告诉我这方面的正确方法是什么?