diff --git a/app/Http/Controllers/MiningTaxes/MiningTaxesController.php b/app/Http/Controllers/MiningTaxes/MiningTaxesController.php index 1d61d38be..2fd33e7fd 100644 --- a/app/Http/Controllers/MiningTaxes/MiningTaxesController.php +++ b/app/Http/Controllers/MiningTaxes/MiningTaxesController.php @@ -176,13 +176,13 @@ class MiningTaxesController extends Controller } foreach($extractions as $extraction) { - foreach($structures as $structure) { + for($i = 0; $i < sizeof($structures); $i++) { //Create the dates in a carbon object, then only get the Y-m-d to compare. $tempStructureDate = Carbon::createFromFormat('Y-m-d H:i:s', $structure['date'])->toDateString(); $extractionDate = Carbon::createFromFormat('Y-m-d H:i:s', $esiHelper->DecodeDate($extraction->chunk_arrival_time))->toDateString(); - //Check if the dates are equal then increase the total by 1 + //check if the dates are equal then increase the total by 1 if($tempStructureDate == $extractionDate) { - $structure['total'] = $structure['total'] + 1; + $structures[$i]['total'] += 1; } } }