mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
do not use string_agg in sqlite due to not implemented in old lib versions (like php docker images)
This commit is contained in:
parent
9e5ee4f65b
commit
91e104064a
1 changed files with 6 additions and 6 deletions
|
|
@ -51,18 +51,18 @@ class TasksController extends ApiController {
|
|||
if ($atv == '^') {
|
||||
$tagIds = [];
|
||||
$tagExIds = [];
|
||||
if ($db::DBTYPE == DBConnection::DBTYPE_MYSQL)
|
||||
$sqlHaving = "tags_ids = ''";
|
||||
else
|
||||
if ($db::DBTYPE == DBConnection::DBTYPE_POSTGRES)
|
||||
$sqlHaving = "string_agg(tags.name, ',') IS NULL"; // catches if tag name is ''
|
||||
else
|
||||
$sqlHaving = "tags_ids IS NULL OR tags_ids = ''";
|
||||
break;
|
||||
}
|
||||
// tasks with any tag
|
||||
else if ($atv == '^^') {
|
||||
if ($db::DBTYPE == DBConnection::DBTYPE_MYSQL)
|
||||
$sqlHaving = "tags_ids != ''";
|
||||
else
|
||||
if ($db::DBTYPE == DBConnection::DBTYPE_POSTGRES)
|
||||
$sqlHaving = "string_agg(tags.name, ',') != ''";
|
||||
else
|
||||
$sqlHaving = "tags_ids != ''";
|
||||
}
|
||||
else if (substr($atv,0,1) == '^') {
|
||||
array_push($tagExIds, ...$dbcore->getTagIdsByName(substr($atv,1)));
|
||||
|
|
|
|||
Loading…
Reference in a new issue