@@ -284,7 +284,6 @@ protected function applyAssignedToUser($inner, $assignedValue, $operator){
284284 $ this ->applyRelationalValue ($ r , $ last , $ operator , ['column ' => 'users.last_name ' ]);
285285 });
286286 });
287-
288287 });
289288 }
290289 protected function applyAssignedToAsset ($ inner , $ assignedValue , $ operator ){
@@ -293,18 +292,18 @@ protected function applyAssignedToAsset($inner, $assignedValue, $operator){
293292 $ inner ->where (function ($ q ) use ($ assignedValue , $ operator ) {
294293 $ q ->whereNotNull ('assets.assigned_to ' )
295294 ->where ('assets.assigned_type ' , Asset::class)
296- ->whereExists (function ($ sub ) use ($ assignedValue , $ operator ) {
297- $ sub ->from ('assets as b ' )
295+ ->whereExists (function ($ sub ) use ($ assignedValue , $ operator ) {
296+ $ sub ->from ('assets as b ' )
298297 ->select ('b.id ' )
299- ->whereColumn ('b.id ' , 'assets.assigned_to ' )
300- ->where (function ($ q2 ) use ($ assignedValue , $ operator ) {
301- if ($ operator === 'equals ' ) {
302- $ q2 ->where ('b.asset_tag ' , '= ' , $ assignedValue )
303- ->orWhere ('b.name ' , '= ' , $ assignedValue );
304- } else {
305- $ q2 ->where ('b.asset_tag ' , 'LIKE ' , '% ' . $ assignedValue . '% ' )
306- ->orWhere ('b.name ' , 'LIKE ' , '% ' . $ assignedValue . '% ' );
307- }
298+ ->whereColumn ('b.id ' , 'assets.assigned_to ' )
299+ ->where (function ($ q2 ) use ($ assignedValue , $ operator ) {
300+ if ($ operator === 'equals ' ) {
301+ $ q2 ->where ('b.asset_tag ' , '= ' , $ assignedValue )
302+ ->orWhere ('b.name ' , '= ' , $ assignedValue );
303+ } else {
304+ $ q2 ->where ('b.asset_tag ' , 'LIKE ' , '% ' . $ assignedValue . '% ' )
305+ ->orWhere ('b.name ' , 'LIKE ' , '% ' . $ assignedValue . '% ' );
306+ }
308307 });
309308 });
310309 });
0 commit comments