refactor TagJob, TagLib and single TagLibs for dynamic use of typeId, add temporary testfile application/libraries/tags/CoreFiftyFiveTagLib.php for testing person_id

This commit is contained in:
ma0068
2026-04-30 11:17:39 +02:00
parent 21eb95bb23
commit d1fa5f64c4
15 changed files with 211 additions and 157 deletions
@@ -433,4 +433,33 @@ class Person_model extends DB_Model
return $this->execReadOnlyQuery($qry, [$person_id]);
}
//just a test function for a person_id tag
//alle personen die innerhalb dieses Zeitraumens 55 werden
public function getFiftyFivers($von, $bis)
{
$qry = "
SELECT
p.person_id
FROM public.tbl_person p
WHERE p.gebdatum >= DATE ? - INTERVAL '55 years'
AND p.gebdatum <= DATE ? - INTERVAL '55 years';
";
return $this->execReadOnlyQuery($qry, [$von, $bis]);
}
//just a test function for a person_id tag
//check if Person gets 55 in this time
public function isFiftyFive($von, $bis, $person_id)
{
$qry = "
SELECT
p.person_id
FROM public.tbl_person p
WHERE p.gebdatum >= DATE ? - INTERVAL '55 years'
AND p.gebdatum <= DATE ? - INTERVAL '55 years'
AND p.persond_id = ?;
";
return $this->execReadOnlyQuery($qry, [$von, $bis, $person_id]);
}
}