fixed query
This commit is contained in:
@@ -10,14 +10,18 @@ class PreorderIFrameModel extends mfBaseModel
|
||||
public function getClusters($frame_referrer): array
|
||||
{
|
||||
$query = "
|
||||
SELECT n.adb_netzgebiet_id as id, ng.name, pc.id as campaign_id, pc.name as campaign_name
|
||||
FROM thetool.Preordercampaign pc
|
||||
JOIN thetool.Network n ON pc.Network_id = n.id
|
||||
JOIN addressdb.Netzgebiet ng ON n.adb_netzgebiet_id = ng.id
|
||||
WHERE JSON_SEARCH(pc.iframe_origins, 'one', '" . $this->db->escape($frame_referrer) . "') IS NOT NULL
|
||||
GROUP BY n.adb_netzgebiet_id, ng.name
|
||||
ORDER BY ng.name ASC
|
||||
";
|
||||
SELECT
|
||||
n.adb_netzgebiet_id as id,
|
||||
ng.name,
|
||||
GROUP_CONCAT(pc.id SEPARATOR ', ') as campaign_ids,
|
||||
GROUP_CONCAT(pc.name SEPARATOR ', ') as campaign_names
|
||||
FROM thetool.Preordercampaign pc
|
||||
JOIN thetool.Network n ON pc.Network_id = n.id
|
||||
JOIN addressdb.Netzgebiet ng ON n.adb_netzgebiet_id = ng.id
|
||||
WHERE JSON_SEARCH(pc.iframe_origins, 'one', '" . $this->db->escape($frame_referrer) . "') IS NOT NULL
|
||||
GROUP BY n.adb_netzgebiet_id, ng.name
|
||||
ORDER BY ng.name ASC
|
||||
";
|
||||
|
||||
$res = $this->db->query($query);
|
||||
$clusters = $this->db->fetch_all_assoc($res);
|
||||
|
||||
Reference in New Issue
Block a user