我正在使用来自ZendFramework2的TableGateway,我的问题是无法使中间函数工作。
这是我现在拥有的代码,输出就是什么都没有:
public function fetchBetween($startDate, $endDate)
{
$where = new Where();
$where->between('date', $startDate, $endDate);
$resultSet = $this->tableGateway->select($where);
return $resultSet;
}我调用这个函数来获取两个日期之间的日期。
$this->getCalendarTable()->fetchBetween('4-04-2014', '30-05-2014');

这是它必须是的查询,而在phpmyadmin中,它返回数据,所以查询或数据库没有任何问题:
SELECT * FROM `klj_agenda` WHERE date BETWEEN '1-05-2014' AND '30-05-2014'发布于 2014-06-15 10:54:04
问题是查询: 2014-05-01而不是01-05-2014
发布于 2014-06-15 06:46:13
我也在使用TableGateWay,我绝不是专家,我从拉尔夫·埃格特的一本书中“偷”了代码。他总是使用tableGateWay->selectWith($select),这是可行的。你的代码有什么区别,我需要调查一下。
https://stackoverflow.com/questions/24221268
复制相似问题