update start date menghitung final log
This commit is contained in:
@@ -8,6 +8,7 @@ use Illuminate\Support\Str;
|
|||||||
use App\Models\Organization;
|
use App\Models\Organization;
|
||||||
use App\Models\File;
|
use App\Models\File;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use App\Models\RequestLogBenefit;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class ReportLogResource extends JsonResource
|
class ReportLogResource extends JsonResource
|
||||||
@@ -28,8 +29,16 @@ class ReportLogResource extends JsonResource
|
|||||||
$parsedDateTime = Carbon::parse($this->created_at);
|
$parsedDateTime = Carbon::parse($this->created_at);
|
||||||
$formattedDateTime = $parsedDateTime->format('Y-m-d H:i:s');
|
$formattedDateTime = $parsedDateTime->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
$timeInsertBenefit = RequestLogBenefit::where('request_log_id', $this->id)->first();
|
||||||
|
|
||||||
|
if ($timeInsertBenefit){
|
||||||
|
$durationFinalGl = Helper::differenceTime($this->created_final_at,$timeInsertBenefit->created_at);
|
||||||
|
} else {
|
||||||
|
$durationFinalGl = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$durationGl = Helper::differenceTime($formattedDateTime, $this->submission_date);
|
$durationGl = Helper::differenceTime($formattedDateTime, $this->submission_date);
|
||||||
$durationFinalGl = Helper::differenceTime($this->created_final_at, $this->approved_final_log_by);
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
|
|||||||
Reference in New Issue
Block a user