fts : the results are now sorted by date if a date/datetime/time field is available
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3463 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
10
fts.php
10
fts.php
@@ -103,6 +103,16 @@ class fts
|
|||||||
$dbl->whereAddParenthesisClose ();
|
$dbl->whereAddParenthesisClose ();
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
// Look for the order by date if provided
|
||||||
|
foreach ($dbl->fields () as $field=>$params)
|
||||||
|
{
|
||||||
|
if ($params[0] == "date" || $params[0] == "datetime" ||
|
||||||
|
$params[0] == "time")
|
||||||
|
{
|
||||||
|
$dbl->orderAdd ($field, "DESC");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
return $dbl->execute ();
|
return $dbl->execute ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user