| Línea 126... |
Línea 126... |
| 126 |
|
126 |
|
| 127 |
array_push($comments, [
|
127 |
array_push($comments, [
|
| 128 |
'date' => $dt->format($serviceDatetimeFormat),
|
128 |
'date' => $dt->format($serviceDatetimeFormat),
|
| 129 |
'image' => $this->url()->fromRoute('storage', ['type' => 'user', 'code' => $user->uuid, 'filename' => $user->image], ['force_canonical' => true]),
|
129 |
'image' => $this->url()->fromRoute('storage', ['type' => 'user', 'code' => $user->uuid, 'filename' => $user->image], ['force_canonical' => true]),
|
| 130 |
'fullname' => trim(trim($user->first_name) . ' ' . trim($user->last_name)),
|
130 |
'fullname' => trim(trim($user->first_name) . ' ' . trim($user->last_name)),
|
| 131 |
'rating' => $record->rating,
|
131 |
'rating' => strval($record->rating),
|
| 132 |
'comment' => $record->comment,
|
132 |
'comment' => $record->comment,
|
| 133 |
'link_delete' => $record->user_id == $currentUser->id ? $this->url()->fromRoute('services/microlearning/capsules/comments/delete', ['capsule_id' => $capsule->uuid, 'comment_id' => $record->uuid], ['force_canonical' => true]) : '',
|
133 |
'link_delete' => $record->user_id == $currentUser->id ? $this->url()->fromRoute('services/microlearning/capsules/comments/delete', ['capsule_id' => $capsule->uuid, 'comment_id' => $record->uuid], ['force_canonical' => true]) : '',
|
| 134 |
]);
|
134 |
]);
|
| Línea 139... |
Línea 139... |
| 139 |
return new JsonModel([
|
139 |
return new JsonModel([
|
| 140 |
'success' => true,
|
140 |
'success' => true,
|
| 141 |
'data' => [
|
141 |
'data' => [
|
| 142 |
'comments' => $comments,
|
142 |
'comments' => $comments,
|
| 143 |
'capsule' => [
|
143 |
'capsule' => [
|
| 144 |
'total_comments' => $dataCountrAndRatingAverage['total_comments'],
|
144 |
'total_comments' => strval($dataCountrAndRatingAverage['total_comments']),
|
| 145 |
'total_rating' => $dataCountrAndRatingAverage['total_rating']
|
145 |
'total_rating' => strval($dataCountrAndRatingAverage['total_rating'])
|
| 146 |
]
|
146 |
]
|
| 147 |
]
|
147 |
]
|
| Línea 148... |
Línea 148... |
| 148 |
|
148 |
|
| Línea 220... |
Línea 220... |
| 220 |
return new JsonModel([
|
220 |
return new JsonModel([
|
| 221 |
'success' => true,
|
221 |
'success' => true,
|
| 222 |
'data' => [
|
222 |
'data' => [
|
| 223 |
'message' => 'LABEL_CAPSULE_COMMENT_HAVE_BEEN_SUCCESSFULLY_DELETE',
|
223 |
'message' => 'LABEL_CAPSULE_COMMENT_HAVE_BEEN_SUCCESSFULLY_DELETE',
|
| 224 |
'capsule' => [
|
224 |
'capsule' => [
|
| 225 |
'total_comments' => $dataCountrAndRatingAverage['total_comments'],
|
225 |
'total_comments' => strval($dataCountrAndRatingAverage['total_comments']),
|
| 226 |
'total_rating' => $dataCountrAndRatingAverage['total_rating']
|
226 |
'total_rating' => strval($dataCountrAndRatingAverage['total_rating'])
|
| 227 |
]
|
227 |
]
|
| 228 |
],
|
228 |
],
|
| Línea 229... |
Línea 229... |
| 229 |
|
229 |
|
| 230 |
]);
|
230 |
]);
|
| Línea 315... |
Línea 315... |
| 315 |
$capsuleComment->company_id = $capsule->company_id;
|
315 |
$capsuleComment->company_id = $capsule->company_id;
|
| 316 |
$capsuleComment->topic_id = $capsule->topic_id;
|
316 |
$capsuleComment->topic_id = $capsule->topic_id;
|
| 317 |
$capsuleComment->capsule_id = $capsule->id;
|
317 |
$capsuleComment->capsule_id = $capsule->id;
|
| 318 |
$capsuleComment->user_id = $currentUser->id;
|
318 |
$capsuleComment->user_id = $currentUser->id;
|
| 319 |
$capsuleComment->comment = $dataPost['comment'];
|
319 |
$capsuleComment->comment = $dataPost['comment'];
|
| 320 |
$capsuleComment->rating = $dataPost['rating'];
|
320 |
$capsuleComment->rating = strval($dataPost['rating']);
|
| 321 |
$capsuleComment->added_on = $dt->format('Y-m-d H:i:s');
|
321 |
$capsuleComment->added_on = $dt->format('Y-m-d H:i:s');
|
| Línea 322... |
Línea 322... |
| 322 |
|
322 |
|
| 323 |
|
323 |
|
| Línea 340... |
Línea 340... |
| 340 |
'comment' => $capsuleComment->comment,
|
340 |
'comment' => $capsuleComment->comment,
|
| 341 |
'rating' => $capsuleComment->rating,
|
341 |
'rating' => $capsuleComment->rating,
|
| 342 |
'link_delete' => $this->url()->fromRoute('services/microlearning/capsules/comments/delete', ['capsule_id' => $capsule->uuid, 'comment_id' => $capsuleComment->uuid], ['force_canonical' => true])
|
342 |
'link_delete' => $this->url()->fromRoute('services/microlearning/capsules/comments/delete', ['capsule_id' => $capsule->uuid, 'comment_id' => $capsuleComment->uuid], ['force_canonical' => true])
|
| 343 |
],
|
343 |
],
|
| 344 |
'capsule' => [
|
344 |
'capsule' => [
|
| 345 |
'total_comments' => $dataCountrAndRatingAverage['total_comments'],
|
345 |
'total_comments' => strval($dataCountrAndRatingAverage['total_comments']),
|
| 346 |
'total_rating' => $dataCountrAndRatingAverage['total_rating']
|
346 |
'total_rating' => strval($dataCountrAndRatingAverage['total_rating'])
|
| 347 |
]
|
347 |
]
|
| 348 |
]
|
348 |
]
|
| Línea 349... |
Línea 349... |
| 349 |
|
349 |
|
| 350 |
]);
|
350 |
]);
|