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