我试图在 ZF2 中使用谓词来查询date
名为的类型列column_date
任何专栏似乎都没有任何效果,而且我太新了,我不确定从哪里开始..
$query = $this->tableGateway->getSql()->select();
$predicate = new Where();
$query->where($predicate->equalTo('user_id' , $params['user_id']));
$query->where($predicate->equalTo('super_type', 'steep'));
$query->where($predicate->greaterThan('column_date',$dateRangeArray[0]));
$query->where($predicate->lessThan('column_date', $dateRangeArray[1]));
$rowset = $this->tableGateway->select($query);
$resultArr = $rowset->toArray();
这是返回的东西不正确user_id
,不正确column_date
..为什么?
dateRangeArray
看起来像这样:
dateRangeArray[0] = 2014-09-01
dateRangeArray[1] = 2015-09-01