WIP Voicenumber Billing 2024-07-05

This commit is contained in:
Frank Schubert
2024-07-06 18:37:40 +02:00
parent 92edb9c812
commit 200af4802a
16 changed files with 417 additions and 220 deletions
@@ -52,8 +52,16 @@ class VoiceplandestinationModel {
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
mfLoghandler::singleton()->debug($where);
$res = $db->select("Voiceplandestination", "*", "$where ORDER BY destination,prefix");
$sql = "SELECT * FROM Voiceplandestination WHERE $where ORDER BY destination,prefix";
$sql = "SELECT Voiceplandestination.* FROM Voiceplandestination
LEFT JOIN Voiceplanzone ON (Voiceplanzone.id = Voiceplandestination.voiceplanzone_id)
WHERE $where
ORDER BY destination,prefix LIMIT 1
";
mfLoghandler::singleton()->debug($sql);
$res = $db->query($sql);
//$res = $db->select("Voiceplandestination", "*", "$where ORDER BY destination,prefix");
if($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new Voiceplandestination($data);
@@ -99,7 +107,7 @@ class VoiceplandestinationModel {
if(is_array($limit) && count($limit)) {
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {
$sql .= " LIMIT ".$limit['start'].", ".$limit['count'];
} elseif(is_numeric($count)) {
} elseif(is_numeric($limit['count'])) {
$sql .= " LIMIT ".$limit['count'];
}
}