Skip to content

Commit 0847126

Browse files
committed
Filtrado de evaluaciones
1 parent 9ff0c68 commit 0847126

File tree

5 files changed

+47
-2
lines changed

5 files changed

+47
-2
lines changed

app/Http/Controllers/EvaluationRESTController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function showEvaluations($id){
127127
->where('evaluation.aprobado',1)
128128
->where('evaluation.idPlace',$id)
129129
->select('places.establecimiento', 'evaluation.comentario',
130-
'evaluation.que_busca', 'evaluation.voto', 'evaluation.updated_at',
130+
'evaluation.que_busca', 'evaluation.service', 'evaluation.voto', 'evaluation.updated_at',
131131
'evaluation.reply_admin', 'evaluation.reply_date', 'evaluation.reply_content')
132132
->get();
133133

public/scripts/home/controllers/city-list/controller.js

+11
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ dondev2App.controller('cityListController',
172172
$http.get(urlComments)
173173
.then(function(response) {
174174
item.comments = response.data;
175+
item.comments = filtrarPorServicio(item.comments);
175176
item.comments.forEach(function(comment) {
176177
comment.que_busca = comment.que_busca.split(',');
177178
});
@@ -192,6 +193,16 @@ dondev2App.controller('cityListController',
192193

193194
};
194195

196+
function filtrarPorServicio(comments){
197+
c=[];
198+
comments.forEach(function(comment){
199+
if(comment.service == $routeParams.servicio){
200+
c.push(comment);
201+
}
202+
});
203+
return c;
204+
};
205+
195206
$scope.$watchCollection('checkbox', function(newValue, oldValue) {
196207
$scope.checkbox = newValue;
197208
if ($scope.checkbox) {

public/scripts/home/controllers/locate-list/controller.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ dondev2App.controller('locateListController',
147147
$http.get(urlComments)
148148
.then(function(response) {
149149
item.comments = response.data;
150-
150+
item.comments = filtrarPorServicio(item.comments);
151151
for (var i = item.comments.length - 1; i >= 0; i--) {
152152
item.comments[i].que_busca = item.comments[i].que_busca.split(',');
153153
}
@@ -166,6 +166,18 @@ dondev2App.controller('locateListController',
166166

167167
}
168168

169+
function filtrarPorServicio(comments){
170+
c=[];
171+
parametros = $routeParams.servicio.split('"');
172+
servicio = parametros[15];
173+
comments.forEach(function(comment){
174+
if(comment.service == servicio){
175+
c.push(comment);
176+
}
177+
});
178+
return c;
179+
};
180+
169181
var onLocationFound = function(position) {
170182
$scope.$apply(function() {
171183

public/scripts/home/controllers/name-list/controller.js

+11
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ dondev2App.controller('nameListController',
183183
$http.get(urlComments)
184184
.then(function(response) {
185185
item.comments = response.data;
186+
item.comments = filtrarPorServicio(item.comments);
186187
item.comments.forEach(function(comment) {
187188
comment.que_busca = comment.que_busca.split(',');
188189
});
@@ -203,6 +204,16 @@ dondev2App.controller('nameListController',
203204

204205
};
205206

207+
function filtrarPorServicio(comments){
208+
c=[];
209+
comments.forEach(function(comment){
210+
if(comment.service == $routeParams.servicio){
211+
c.push(comment);
212+
}
213+
});
214+
return c;
215+
};
216+
206217
$scope.$watchCollection('checkbox', function(newValue, oldValue) {
207218
$scope.checkbox = newValue;
208219
if ($scope.checkbox) {

public/scripts/home/controllers/party-list/controller.js

+11
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ dondev2App.controller('partyListController',
174174
$http.get(urlComments)
175175
.then(function(response) {
176176
item.comments = response.data;
177+
item.comments = filtrarPorServicio(item.comments);
177178
item.comments.forEach(function(comment) {
178179
comment.que_busca = comment.que_busca.split(',');
179180
});
@@ -194,6 +195,16 @@ dondev2App.controller('partyListController',
194195

195196
};
196197

198+
function filtrarPorServicio(comments){
199+
c=[];
200+
comments.forEach(function(comment){
201+
if(comment.service == $routeParams.servicio){
202+
c.push(comment);
203+
}
204+
});
205+
return c;
206+
};
207+
197208
$scope.$watchCollection('checkbox', function(newValue, oldValue) {
198209
$scope.checkbox = newValue;
199210
if ($scope.checkbox) {

0 commit comments

Comments
 (0)