model user fix

This commit is contained in:
SJ 2014-07-07 12:32:38 +02:00
parent 66480ebeb9
commit 32d87ee3b6

View File

@ -68,8 +68,16 @@ class ModelUserUser extends Model {
}
$emails = $this->get_email_addresses_from_groups($data);
$data = array_merge($data, $emails);
$query = $this->db->query("SELECT g.email FROM `" . TABLE_GROUP_EMAIL . "` g WHERE g.id IN (SELECT u.id FROM `" . TABLE_GROUP_USER . "` u WHERE u.email IN (?))", $data);
return $data;
}
public function get_email_addresses_from_groups($emails = array()) {
$data = array();
$query = $this->db->query("SELECT g.email FROM `" . TABLE_GROUP_EMAIL . "` g WHERE g.id IN (SELECT u.id FROM `" . TABLE_GROUP_USER . "` u WHERE u.email IN (?))", $emails);
if(isset($query->rows)) {
foreach ($query->rows as $q) {