This repository was archived by the owner on Jan 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ class Like extends Mode
1111
1212 public function buildWhereRawString (Builder $ builder )
1313 {
14+ $ table = $ builder ->model ->getTable ();
15+
1416 $ queryString = '' ;
1517
1618 $ this ->fields = $ this ->modelService ->setModel ($ builder ->model )->getSearchableFields ();
@@ -20,7 +22,7 @@ public function buildWhereRawString(Builder $builder)
2022 $ queryString .= '( ' ;
2123
2224 foreach ($ this ->fields as $ field ) {
23- $ queryString .= "` $ field` LIKE ? OR " ;
25+ $ queryString .= "` $ table `.` $ field` LIKE ? OR " ;
2426 }
2527
2628 $ queryString = trim ($ queryString , 'OR ' );
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ class LikeExpanded extends Mode
1111
1212 public function buildWhereRawString (Builder $ builder )
1313 {
14+ $ table = $ builder ->model ->getTable ();
15+
1416 $ queryString = '' ;
1517
1618 $ this ->fields = $ this ->modelService ->setModel ($ builder ->model )->getSearchableFields ();
@@ -23,14 +25,14 @@ public function buildWhereRawString(Builder $builder)
2325
2426 foreach ($ this ->fields as $ field ) {
2527 foreach ($ words as $ word ) {
26- $ queryString .= "` $ field` LIKE ? OR " ;
28+ $ queryString .= "` $ table `.` $ field` LIKE ? OR " ;
2729 }
2830 }
2931
3032 $ queryString = trim ($ queryString , 'OR ' );
3133 $ queryString .= ') ' ;
3234
33- return $ queryString ;
35+ return $ queryString ;
3436 }
3537
3638 public function buildParams (Builder $ builder )
You can’t perform that action at this time.
0 commit comments