select vorname, nachname, email, reminder_send, m.id as mitgliedschaftId , case when m.betrag = -1 then mt.betrag else m.betrag end as kib_betrag , (select po.payment_year from kib_membership_payment po where po.kib_membership_id =m.id and po.is_spende = 0 order by po.payment_year desc limit 1) as py, kib_membership_type_id as typ, m.betrag as extra_betrag, mt.betrag as norm_betrag from kib_person p, kib_membership m left outer join kib_membership_type mt on mt.id = m.kib_membership_type_id where m.id = p.kib_membership_id and date_add(m.payment_start_date, interval m.reminder_send + 1 week ) < CURDATE() and (m.kib_membership_status = 1 or m.kib_membership_status = 2) and not exists (select * from kib_membership_payment mp where mp.kib_membership_id = m.id and (mp.payment_year = YEAR(CURDATE())) and mp.is_spende = 0) limit 30
(object) array( 'vorname' => 'Angelika', 'nachname' => 'Felbermeir', 'email' => 'angelika.felbermeir@web.de', 'reminder_send' => '0', 'mitgliedschaftId' => '887', 'kib_betrag' => '50', 'py' => NULL, 'typ' => '1', 'extra_betrag' => '-1', 'norm_betrag' => '50', )
(object) array( 'vorname' => 'Stephanie', 'nachname' => 'Hammeley', 'email' => 'Stephanie@Hammeley.de', 'reminder_send' => '0', 'mitgliedschaftId' => '891', 'kib_betrag' => '50', 'py' => NULL, 'typ' => '1', 'extra_betrag' => '-1', 'norm_betrag' => '50', )
(object) array( 'vorname' => 'Anja', 'nachname' => 'Kühn', 'email' => 'anja@kuehns.ch', 'reminder_send' => '0', 'mitgliedschaftId' => '859', 'kib_betrag' => '50', 'py' => NULL, 'typ' => '1', 'extra_betrag' => '-1', 'norm_betrag' => '50', )
(object) array( 'vorname' => 'Miriam ', 'nachname' => 'hock', 'email' => 'miriam_schack@hotmail.de', 'reminder_send' => '0', 'mitgliedschaftId' => '862', 'kib_betrag' => '50', 'py' => NULL, 'typ' => '1', 'extra_betrag' => '-1', 'norm_betrag' => '50', )
(object) array( 'vorname' => 'Melanie', 'nachname' => 'Boge', 'email' => 'boge.melanie@gmx.de', 'reminder_send' => '0', 'mitgliedschaftId' => '865', 'kib_betrag' => '50', 'py' => NULL, 'typ' => '1', 'extra_betrag' => '-1', 'norm_betrag' => '50', )
(object) array( 'vorname' => 'Nicole ', 'nachname' => 'Meißner ', 'email' => 'nicole.meissner@ok.de', 'reminder_send' => '0', 'mitgliedschaftId' => '874', 'kib_betrag' => '50', 'py' => NULL, 'typ' => '1', 'extra_betrag' => '-1', 'norm_betrag' => '50', )
(object) array( 'vorname' => 'Daniela', 'nachname' => 'HEYDER', 'email' => 'daniela.koettig@gmx.de', 'reminder_send' => '0', 'mitgliedschaftId' => '886', 'kib_betrag' => '50', 'py' => NULL, 'typ' => '1', 'extra_betrag' => '-1', 'norm_betrag' => '50', )
ende