Professional Documents
Culture Documents
app/Http/Controllers/API/PartakerController.php
... ... @@ -12,9 +12,11 @@ class PartakerController extends Controller
12 12 public function getCarers(Request $request)
13 13 {
14 14 $param = $request->q ?? '';
15 - $data = Partaker::where('first_name', 'like', "%{$param}%")
16 - ->orWhere('last_name', 'like', "%{$param}%")
17 - ->where('pot_source_id', 3);
15 + $data = Partaker::where('pot_source_id', 3)
16 + ->where(function($query) use($param) {
17 + $query->where('last_name', 'like', "%{$param}%")
18 + ->orWhere('first_name', 'like', "%{$param}%");
19 + });
18 20
19 21 if (auth()->user()->isA(role('ADMIN'))) {
20 22 $data = $data->where('client_id', auth()->user()->client_id);
... ... @@ -26,9 +28,11 @@ class PartakerController extends Controller
26 28 public function getTeachers(Request $request)
27 29 {
28 30 $param = $request->q ?? '';
29 - $data = Partaker::where('first_name', 'like', "%{$param}%")
30 - ->orWhere('last_name', 'like', "%{$param}%")
31 - ->where('pot_source_id', 2);
31 + $data = Partaker::where('pot_source_id', 2)
32 + ->where(function($query) use($param) {
33 + $query->where('last_name', 'like', "%{$param}%")
34 + ->orWhere('first_name', 'like', "%{$param}%");
35 + });
32 36
33 37 if (auth()->user()->isA(role('ADMIN'))) {
34 38 $data = $data->where('client_id', auth()->user()->client_id);
... ...
app/Models/Partaker.php
resources/views/admin/partakers/edit.blade.php
resources/views/admin/partakers/show.blade.php
... ... @@ -93,6 +93,35 @@
93 93 </div>
94 94 </div>
95 95
96 + @if($partaker->carer_id)
97 + <h2>Responsables del estudiante</h2>
98 + <div class="row mb-4 p-3 border rounded">
99 + <div class="col-lg-6">
100 + <div class="form-group">
101 + <label for="">Familiar/Cuidador</label>
102 + <h3>{{$partaker->carer->fullName}}</h3>
103 + <small>
104 + ({{$partaker->carer->identificationType->name}}
105 + {{$partaker->carer->identification}})
106 + </small>
107 + </div>
108 + </div>
109 +
110 + <div class="col-lg-6">
111 + <div class="form-group">
112 + <label for="">Docente</label>
113 + <h3>
114 + {{$partaker->teacher->fullName}}
115 + <small>
116 + ({{$partaker->teacher->identificationType->name}}
117 + {{$partaker->teacher->identification}})
118 + </small>
119 + </h3>
120 + </div>
121 + </div>
122 + </div>
123 + @endif
124 +
96 125
97 126 <div class="my-4">
98 127 <a href="javascript: history.go(-1)" class="btn btn-secondary">
... ...
https://gitlab.com/guille.agudelo/apptalento/-/commit/f25213be8a051a588cabc8d208f15575501c1bd7 2/3
1/8/2020 Termina agregar UI campos nuevos tabla partakers (f25213be) · Commits · Guillermo Agudelo / apptalento · GitLab
https://gitlab.com/guille.agudelo/apptalento/-/commit/f25213be8a051a588cabc8d208f15575501c1bd7 3/3