Jaxel
Well-known member
If I am fetching results from a table called
However, what if I wanted to do the equivalent of:
What would be the best way to do this?
packages
, with the relation of colors
, I could do the following:
Code:
$this->finder('EWR\Addon:Package')
->with(['Color'])
->fetch();
However, what if I wanted to do the equivalent of:
Code:
SELECT ...
IF(NOT ISNULL(color.color_id), color.color_options, package.color_options) AS color_options
What would be the best way to do this?