在存儲庫中使用您自己的函數。
控制器
/**
* action list
*
* @param integer $minUid
* @param integer $maxUid
* @return void
*/
public function listAction() {
$this->view->assign('records', $this->testRepository->findUidRange($minUid,$maxUid));
}
庫
/**
* Find records filtered by uid from to
*
* @param integer $minUid
* @param integer $maxUid
* @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface|array The query result
*/
public function findUidRange($minUid = NULL, $maxUid = NULL) {
$query = $this->createQuery();
return $query->matching(
$query->logicalAnd(
$query->greaterThan('uid', $minUid),
$query->lessThan('uid', $maxUid),
$query->equals('deleted', 0)
))->execute();
}
大,工作就像一個魅力。非常感謝! –