I have a question, I have a database query for a events site is there any way I can do this in a get() call so I can keep the has_one relations?
My query:
$records = DB::query("SELECT
b.Name, b.InfoPage, (b.ID) AS VenueID, (b.List) AS VenueList,
alias_event.*,
min(StartDateTime) AS firstdate,
GROUP_CONCAT( StartDateTime ORDER BY StartDateTime ASC ) AS alldates,
GROUP_CONCAT( alias_event.id ORDER BY StartDateTime ASC) AS allids
FROM ( SELECT
*
FROM
event
WHERE
List = 'true' AND
StartDateTime >= NOW() AND
((ListDate IS NULL OR ListDate = '') OR ListDate < NOW())
ORDER BY StartDateTime DESC
) AS alias_event
LEFT JOIN locations AS b ON alias_event.LocationID = b.ID
LEFT JOIN file AS c ON alias_event.EventImageID = c.ID
LEFT JOIN file AS d ON alias_event.EventBannerID = d.ID
WHERE
alias_event.List = 'true' AND
StartDateTime >= NOW() AND
((ListDate IS NULL OR ListDate = '') OR ListDate < NOW())
GROUP BY
CONCAT_WS(
',',
Artist,
Support,
Special,
OnsaleDateTime > NOW(),
IF(EventStatus = 'Soldout', '' , EventStatus)
)
ORDER BY
StartDateTime ASC"