@@ 92-101 (lines=10) @@ | ||
89 | } |
|
90 | $modelTableName = $query->getModel()->getTable(); |
|
91 | if ($isFirstField || $modelForceAndWhere) { |
|
92 | if (! is_null($value)) { |
|
93 | if (! is_null($relation)) { |
|
94 | $query->whereHas($relation, function ($query) use ($field, $condition, $value) { |
|
95 | $query->where($field, $condition, $value); |
|
96 | }); |
|
97 | } else { |
|
98 | $query->where($modelTableName.'.'.$field, $condition, $value); |
|
99 | } |
|
100 | $isFirstField = false; |
|
101 | } |
|
102 | } else { |
|
103 | if (! is_null($value)) { |
|
104 | if (! is_null($relation)) { |
|
@@ 102-112 (lines=11) @@ | ||
99 | } |
|
100 | $isFirstField = false; |
|
101 | } |
|
102 | } else { |
|
103 | if (! is_null($value)) { |
|
104 | if (! is_null($relation)) { |
|
105 | $query->orWhereHas($relation, function ($query) use ($field, $condition, $value) { |
|
106 | $query->where($field, $condition, $value); |
|
107 | }); |
|
108 | } else { |
|
109 | $query->orWhere($modelTableName.'.'.$field, $condition, $value); |
|
110 | } |
|
111 | } |
|
112 | } |
|
113 | } |
|
114 | }); |
|
115 | } |