Skip to content

Commit

Permalink
Merge pull request #45 from Ninjinka/patch-1
Browse files Browse the repository at this point in the history
Added a comma separated list of List associated with the Campaign
  • Loading branch information
michield committed Feb 16, 2017
2 parents fee6bfe + 059b644 commit 68340b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/restapi/includes/campaigns.php
Expand Up @@ -67,8 +67,10 @@ public static function campaignsGet($order_by = 'modified', $order = 'desc', $li
}

$subsql = "SELECT COUNT(userid) FROM " . $GLOBALS['tables']['usermessage'] . " WHERE viewed IS NOT NULL AND status = 'sent' and messageid = m.id";

$sublists = "SELECT GROUP_CONCAT(`listid` SEPARATOR ',') from ".$GLOBALS['tables']['listmessage']." WHERE messageid = m.id";

$sql = "SELECT COALESCE(SUM(clicked), 0) AS clicked, (" . $subsql . ") AS uviews, ";
$sql .= "(".$sublists.") as lists ,";
$sql .= "m.* ";
$sql .= "FROM " . $GLOBALS['tables']['message'] . " AS m ";
$sql .= "LEFT JOIN " . $GLOBALS['tables']['linktrack_uml_click'] . " AS c ON ( c.messageid = m.id ) ";
Expand Down

0 comments on commit 68340b2

Please sign in to comment.