My main tip: Stop trying to force your own model names and fieldnames
and use cakes conventions, makes life a whole lot easier!
Why are you joining Meal/meals when you're not pulling any fields from
it, or have you missed out some fields?
If you were conforming to Cake's conventions you would run the
following (I have included an echo debug at the bottom so you can see
the way the data array is structured which tells you how to access the
data in your view.):
$this->data = $this->BookingPosition->find('all', array(
'fields' => array(
'DISTINCT BookingPosition.anreise_datum',
'BookingPosition.abreise_datum',
'Request.name',
'Request.anzahl_erwachsene',
'Request.anzahl_jugendliche',
'Request.anzahl_kinder',
'Request.meal_0_id', // for scalability I would replace these with
a hasMany association
'Request.meal_1_id', // for scalability I would replace these with
a hasMany association
'Request.meal_2_id', // for scalability I would replace these with
a hasMany association
'Booking.name',
'Lodging.zimmernummer',
'CONCAT (CS.name, ': ', CS.Firma, ': ', CS.Vorname, ', ',
CS.Nachname) AS kunde'
),
'order' => array('BookingPosition.anreise_datum')
));
echo debug($this->data);
HTH
Paul
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en