src/snac/server/database/SQL.php
/**
     * Read Analytics by Domain
     *
     * Read outbound link traffic analytics
     *
     * @param string $domain The unique domain to return counts for
     * @return array $results Array of dates and hit counts
     */
Read Analytics by Domain
Read outbound link traffic analytics

@param string $domain The unique domain to return counts for
@return array $results Array of dates and hit counts
Read Analytics by Domain Read outbound link traffic analytics @param string $domain The unique domain to return counts for @return array $results Array of dates and hit counts
public function selectAnalyticsbyDomain($domain) {
        $sql = "SELECT count(*), to_char(timestamp, 'yyyy-mm') AS date
                FROM outbound_link
                WHERE url ilike $1
                AND timestamp > (NOW() - INTERVAL '1 year')
                GROUP BY date;";
        $result = $this->sdb->query($sql, ["%".$domain."%"]);
        $results = $this->sdb->fetchAll($result);
        return $results;
    }
public function selectAnalyticsbyDomain ( $ domain ) { $ sql = " SELECT count(*), to_char(timestamp, 'yyyy-mm') AS date
                FROM outbound_link
                WHERE url ilike $1
                AND timestamp > (NOW() - INTERVAL '1 year')
                GROUP BY date; " ; $ result = $ this -> sdb -> query ( $ sql , [ " % " . $ domain . " % " ] ) ; $ results = $ this -> sdb -> fetchAll ( $ result ) ; return $ results ; }
Read Analytics by Domain
 Read outbound link traffic analytics
Read Analytics by Domain Read outbound link traffic analytics