diff --git a/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php b/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php index 355a770e..6c7e6155 100644 --- a/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php +++ b/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php @@ -533,7 +533,14 @@ class RequestLogController extends Controller ->where('files.fileable_type', '=', 'App\Models\Signature') ->where('signatures.type', '=', 2) ->where('signatures.user_id', '=', $dataRequestLog->approved_by) - ->select('files.path') + ->select( + 'files.path', + DB::raw(' + (Select persons.name FROM users + LEFT JOIN persons ON users.person_id = persons.id + WHERE users.id = "'.$dataRequestLog->approved_by.'" LIMIT 1) AS name_approve + ') + ) ->first(); $data['signatureAd'] = $signatureAd; @@ -705,7 +712,14 @@ class RequestLogController extends Controller ->where('files.fileable_type', '=', 'App\Models\Signature') ->where('signatures.type', '=', 2) ->where('signatures.user_id', '=', $dataRequestLog->approved_by) - ->select('files.path') + ->select( + 'files.path', + DB::raw(' + (Select persons.name FROM users + LEFT JOIN persons ON users.person_id = persons.id + WHERE users.id = "'.$dataRequestLog->approved_by.'" LIMIT 1) AS name_approve + ') + ) ->first(); $data['signatureAd'] = $signatureAd; diff --git a/resources/views/pdf/final_log_page_2.blade.php b/resources/views/pdf/final_log_page_2.blade.php index fb8ee714..f2a154dc 100644 --- a/resources/views/pdf/final_log_page_2.blade.php +++ b/resources/views/pdf/final_log_page_2.blade.php @@ -304,8 +304,18 @@ @endphp