@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | return TechTips::orderBy('sticky', 'DESC') |
50 | 50 | ->orderBy('created_at', 'DESC') |
51 | 51 | // Search text fields |
52 | - ->when(!empty($searchText), function($q) use ($searchText) |
|
53 | - { |
|
52 | + ->when(!empty($searchText), function($q) use ($searchText) { |
|
54 | 53 | foreach($searchText as $text) |
55 | 54 | { |
56 | 55 | $q->orWhere('subject', 'like', '%'.$text.'%') |
@@ -59,15 +58,12 @@ discard block |
||
59 | 58 | } |
60 | 59 | }) |
61 | 60 | // Search Article Type fields |
62 | - ->when($type, function($q) use ($type) |
|
63 | - { |
|
61 | + ->when($type, function($q) use ($type) { |
|
64 | 62 | $q->whereIn('tip_type_id', $type); |
65 | 63 | }) |
66 | 64 | // Search equipment type fields |
67 | - ->when($sys, function($q) use ($sys) |
|
68 | - { |
|
69 | - $q->whereHas('SystemTypes', function($q2) use ($sys) |
|
70 | - { |
|
65 | + ->when($sys, function($q) use ($sys) { |
|
66 | + $q->whereHas('SystemTypes', function($q2) use ($sys) { |
|
71 | 67 | $q2->whereIn('system_types.sys_id', $sys); |
72 | 68 | }); |
73 | 69 | }) |