-
-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
Hi ;
The BETWEEN operator doesn't seem to work in a has() relation filter :
$entity->has("service", ["date BETWEEN ? AND ?", "2024-02-01", "2024-02-29"]); // error
$entity->has("service", ["? <= date AND date <= ?", "2024-02-01", "2024-02-29"]); // works
$result = $entity->find(["pupil_id = ?", 12], []);
I get this error :
500 Internal Server Error
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[table][rel_field].BETWEEN '2024-02-01' AND '2024-02-29')' at line 1 [[project_path]/vendor/bcosca/fatfree-core/db/sql.php:230]
of course, the same filter directly on the sub-entity work well :
$res2 = $entity2->find(["date BETWEEN ? AND ?", "2024-02-01", "2024-02-29"]);