49 lines
1.3 KiB
PHP
49 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
use Carbon\Carbon;
|
|
|
|
|
|
class RingkasanHarianServices
|
|
{
|
|
|
|
public function getRingkasanHarian($mula,$hingga,$kodcaw = null,$jenisgenerate) : Array{
|
|
if($jenisgenerate == 'all'){
|
|
$response = Http::get(config('api.url'). '/admin/get/ringkasanharian/' ,[
|
|
'mula' => $mula,
|
|
'hingga' => $hingga,
|
|
'kodcaw' => 'all',
|
|
])->json();
|
|
}else{
|
|
$response = Http::get(config('api.url'). '/admin/get/ringkasanharian/' ,[
|
|
'mula' => $mula,
|
|
'hingga' => $hingga,
|
|
'kodcaw' => $kodcaw,
|
|
])->json();
|
|
}
|
|
|
|
return $response;
|
|
}
|
|
|
|
public function saveRingkasanHarian($mula,$hingga,$zone,$jenisgenerate) : Object{
|
|
if($jenisgenerate == 'daily'){
|
|
$response = Http::get(config('api.url'). '/admin/store/ringkasanharian/' ,[
|
|
'mula' => $mula,
|
|
'hingga' => $hingga,
|
|
'zone' => $zone,
|
|
])->json();
|
|
|
|
}else{
|
|
$response = Http::get(config('api.url'). '/admin/store/ringkasanharian/' ,[
|
|
'mula' => $mula,
|
|
'hingga' => $hingga,
|
|
'zone' => $zone,
|
|
])->json();
|
|
}
|
|
return response($response);
|
|
}
|
|
}
|