1
我嘗試建立自定義的搜索表單和篩選結果在一定範圍內的日期:過濾日期範圍
$form = BootstrapForm::create (
$this,
'LetterSearchForm',
FieldList::create (
DateField::create('Sent_After','Sent After'),
DateField::create('Sent_Befor','Sent Before')
...
),
...
);
public function index (SS_HTTPRequest $request)
{
$letters = Letter::get()->sort('DateUpload');
if($search = $request->getVar('Sender')) {
$letters = $letters->filter(array(
'Sender:PartialMatch' => $search
));
}
if ($search1 = $request->getVar('Sent_After') && $search2 = $request->getVar('Sent_Befor'))
{
What must be here?
}
}
}
我可以在這裏使用類似WithinRangeFilter?
它的工作原理!謝謝利奧! – alex