23 lines
604 B
PHP
23 lines
604 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\CsvController\CsvCostCalc;
|
|
|
|
class CsvTotalCostCalc
|
|
{
|
|
private $CsvMinuteCostCalc;
|
|
public function __construct()
|
|
{
|
|
|
|
$this->CsvMinuteCostCalc = new CsvMinuteCostCalc();
|
|
}
|
|
|
|
function total_time_cost(array $array, int $total_time)
|
|
{
|
|
$minute_cost = $this->CsvMinuteCostCalc->select_correct_cost($array['Request By'], $array['Priority']);
|
|
$total_cost = $total_time / 60 * $minute_cost;
|
|
$array['Tempo totale'] = gmdate('H:i:s', $total_time);
|
|
$array['Costo totale'] = $total_cost;
|
|
return $array;
|
|
}
|
|
}
|