|
|
@@ -62,7 +62,7 @@ class BxMassMailerDb extends BxBaseModGeneralDb
|
|
|
|
|
|
public function getAccountsByTerms($sTerms = "")
|
|
|
{
|
|
|
- $sSql = "SELECT `ta`.`email`, `tp`.`id` AS `profile_id` FROM `sys_accounts` AS `ta` INNER JOIN `sys_profiles` AS `tp` ON `tp`.`account_id`=`ta`.`id` " . $sTerms . " WHERE `ta`.`receive_news` <> 0 AND `ta`.`email_confirmed` = 1";
|
|
|
+ $sSql = "SELECT `ta`.`email`, `tp`.`id` AS `profile_id` FROM `sys_accounts` AS `ta` " . $sTerms . " WHERE `ta`.`receive_news` <> 0 AND `ta`.`email_confirmed` = 1";
|
|
|
return $this->getAll($sSql);
|
|
|
}
|
|
|
|
|
|
@@ -72,7 +72,7 @@ class BxMassMailerDb extends BxBaseModGeneralDb
|
|
|
'datefrom' => $iDateFrom,
|
|
|
'dateto' => $iDateTo
|
|
|
);
|
|
|
- $sSql = "SELECT DATE(FROM_UNIXTIME(`ta`.`added`)) AS `period`, YEAR(FROM_UNIXTIME(`ta`.`added`)) AS `year`, COUNT(*) AS `count` FROM `sys_accounts` AS `ta` INNER JOIN `sys_profiles` AS `tp` ON `tp`.`account_id`=`ta`.`id` " . $sTerms . " WHERE `ta`.`receive_news` <> 0 AND `ta`.`email_confirmed` = 1 AND `ta`.`added` >= :datefrom AND `ta`.`added` <= :dateto GROUP BY `period`, `year` ORDER BY `year`, `period` ASC";
|
|
|
+ $sSql = "SELECT DATE(FROM_UNIXTIME(`ta`.`added`)) AS `period`, YEAR(FROM_UNIXTIME(`ta`.`added`)) AS `year`, COUNT(*) AS `count` FROM `sys_accounts` AS `ta` " . $sTerms . " WHERE `ta`.`receive_news` <> 0 AND `ta`.`email_confirmed` = 1 AND `ta`.`added` >= :datefrom AND `ta`.`added` <= :dateto GROUP BY `period`, `year` ORDER BY `year`, `period` ASC";
|
|
|
return $this->getAll($sSql, $aBindings);
|
|
|
}
|
|
|
|
|
|
@@ -83,7 +83,7 @@ class BxMassMailerDb extends BxBaseModGeneralDb
|
|
|
'datefrom' => $iDateFrom,
|
|
|
'dateto' => $iDateTo
|
|
|
);
|
|
|
- $sSql = "SELECT DATE(FROM_UNIXTIME(`tu`.`unsubscribed`)) AS `period`, YEAR(FROM_UNIXTIME(`tu`.`unsubscribed`)) AS `year`, COUNT(*) AS `count` FROM `sys_accounts` AS `ta` INNER JOIN `" . $CNF['TABLE_UNSUBSCRIBE'] . "` AS `tu` ON `tu`.`account_id`=`ta`.`id` INNER JOIN `sys_profiles` AS `tp` ON `tp`.`account_id`=`ta`.`id` " . $sTerms . " WHERE `tu`.`unsubscribed` >= :datefrom AND `tu`.`unsubscribed` <= :dateto GROUP BY `period`, `year` ORDER BY `year`, `period` ASC";
|
|
|
+ $sSql = "SELECT DATE(FROM_UNIXTIME(`tu`.`unsubscribed`)) AS `period`, YEAR(FROM_UNIXTIME(`tu`.`unsubscribed`)) AS `year`, COUNT(*) AS `count` FROM `sys_accounts` AS `ta` INNER JOIN `" . $CNF['TABLE_UNSUBSCRIBE'] . "` AS `tu` ON `tu`.`account_id`=`ta`.`id` " . $sTerms . " WHERE `tu`.`unsubscribed` >= :datefrom AND `tu`.`unsubscribed` <= :dateto GROUP BY `period`, `year` ORDER BY `year`, `period` ASC";
|
|
|
return $this->getAll($sSql, $aBindings);
|
|
|
}
|
|
|
|
|
|
@@ -92,7 +92,7 @@ class BxMassMailerDb extends BxBaseModGeneralDb
|
|
|
$aBindings = array(
|
|
|
'datefrom' => $iDateFrom
|
|
|
);
|
|
|
- $sQuery = "SELECT COUNT(`ta`.`id`) AS `count` FROM `sys_accounts` AS `ta` INNER JOIN `sys_profiles` AS `tp` ON `tp`.`account_id`=`ta`.`id` " . $sTerms . " WHERE `ta`.`added` < :datefrom ";
|
|
|
+ $sQuery = "SELECT COUNT(`ta`.`id`) AS `count` FROM `sys_accounts` AS `ta` " . $sTerms . " WHERE `ta`.`added` < :datefrom ";
|
|
|
return $this->getOne($sQuery, $aBindings);
|
|
|
}
|
|
|
|
|
|
@@ -102,7 +102,7 @@ class BxMassMailerDb extends BxBaseModGeneralDb
|
|
|
$aBindings = array(
|
|
|
'datefrom' => $iDateFrom
|
|
|
);
|
|
|
- $sQuery = "SELECT COUNT(`tu`.`id`) AS `count` FROM `sys_accounts` AS `ta` INNER JOIN `" . $CNF['TABLE_UNSUBSCRIBE'] . "` AS `tu` ON `tu`.`account_id`=`ta`.`id` INNER JOIN `sys_profiles` AS `tp` ON `tp`.`account_id`=`ta`.`id` " . $sTerms . " WHERE `tu`.`unsubscribed` < :datefrom ";
|
|
|
+ $sQuery = "SELECT COUNT(`tu`.`id`) AS `count` FROM `sys_accounts` AS `ta` INNER JOIN `" . $CNF['TABLE_UNSUBSCRIBE'] . "` AS `tu` ON `tu`.`account_id`=`ta`.`id` " . $sTerms . " WHERE `tu`.`unsubscribed` < :datefrom ";
|
|
|
return $this->getOne($sQuery, $aBindings);
|
|
|
}
|
|
|
|