File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -728,14 +728,15 @@ protected function isRelation($model, $relationName)
728
728
* Get the qualified column name
729
729
*
730
730
* @param string $column
731
+ * @param null $table
731
732
* @return string
732
733
*/
733
734
protected function getQualifiedColumnName ($ column , $ table = null )
734
735
{
735
736
//Check whether there is a matching column expression that contains an
736
737
//alias and should therefore not be turned into a qualified column name.
737
- $ isAlias = count (array_filter ($ this ->query ->columns ?: [], function ($ column ) {
738
- return stripos ( $ column, ' as ' ) !== false ;
738
+ $ isAlias = count (array_filter ($ this ->query ->columns ?: [], function ($ queryColumn ) use ( $ column ) {
739
+ return preg_match ( ' /.*[\s \' "`]as\s*[\s \' "`] ' . $ column . ' [ \' "`]?$/ ' , trim ( $ queryColumn )) ;
739
740
})) > 0 ;
740
741
741
742
if (strpos ($ column , '. ' ) === false && !$ isAlias ) {
You can’t perform that action at this time.
0 commit comments