php-sql-query-builder icon indicating copy to clipboard operation
php-sql-query-builder copied to clipboard

How use left join in foreach?

Open misterkonst opened this issue 3 years ago • 0 comments

foreach ($model_params as $join_key => $join_value) {
            if ($join_value->relationship !== null) {
                $query->leftJoin(
                    $join_value->relationship,
                    $join_key,
                    $join_value->foreign_key,
                );
            }
        }

Hi, how u can see I use left join in foreach, but in sql code have only one join, what am I doing wrong?

misterkonst avatar May 14 '21 04:05 misterkonst