|
@@ -89,6 +89,7 @@ class WellnessRecordController extends Curd
|
|
|
$items = $paginator
|
|
|
->items();
|
|
|
$itemsNew = [];
|
|
|
+ dump($items);
|
|
|
foreach ($items as $item) {
|
|
|
$itemNew = [
|
|
|
'wellness_record_id' => $item->wellness_record_id,
|
|
@@ -104,11 +105,10 @@ class WellnessRecordController extends Curd
|
|
|
];
|
|
|
if (!empty($item->wellness_record_file_json)) {
|
|
|
$item->wellness_record_file_json = json_decode($item->wellness_record_file_json, true);
|
|
|
- $upload = SysUpload::whereIn('upload_file_path', $item->wellness_record_file_json)->get();
|
|
|
- foreach ($upload as $value) {
|
|
|
+ foreach ($item->wellness_record_file_json as $value) {
|
|
|
$itemNew['wellness_record_file_json'][] = [
|
|
|
- 'url' => getenv('STORAGE_DOMAIN') . $value->upload_file_path,
|
|
|
- 'name' => $value->upload_name
|
|
|
+ 'url' => getenv('STORAGE_DOMAIN') . $value['url'],
|
|
|
+ 'name' => $value['name']
|
|
|
];
|
|
|
}
|
|
|
}
|
|
@@ -207,10 +207,6 @@ class WellnessRecordController extends Curd
|
|
|
{
|
|
|
$data = $this->inputFilter($request->post());
|
|
|
$data['wellness_record_datetime'] = date('Y-m-d H:i:s', strtotime($data['wellness_record_datetime']));
|
|
|
- if (!empty($data['wellness_record_file_json'])) {
|
|
|
- $data['wellness_record_file_json'] = str_replace(getenv('STORAGE_DOMAIN'), '', $data['wellness_record_file_json']);
|
|
|
- $data['wellness_record_file_json'] = json_encode(explode(',', $data['wellness_record_file_json']));
|
|
|
- }
|
|
|
|
|
|
return $data;
|
|
|
}
|