fix filter year dashboard
This commit is contained in:
@@ -19,11 +19,12 @@ class BigDataResumeController extends Controller
|
|||||||
try{
|
try{
|
||||||
$filterDate = $request->get("filterByDate");
|
$filterDate = $request->get("filterByDate");
|
||||||
|
|
||||||
// If filterByDate is "latest" or empty, get the most recent record
|
|
||||||
if (!$filterDate || $filterDate === "latest") {
|
if (!$filterDate || $filterDate === "latest") {
|
||||||
$big_data_resume = BigdataResume::latest()->first();
|
$big_data_resume = BigdataResume::where('year', now()->year)->latest()->first();
|
||||||
|
if (!$big_data_resume) {
|
||||||
|
return $this->response_empty_resume();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Filter by specific date
|
|
||||||
$big_data_resume = BigdataResume::whereDate('created_at', $filterDate)
|
$big_data_resume = BigdataResume::whereDate('created_at', $filterDate)
|
||||||
->orderBy('id', 'desc')
|
->orderBy('id', 'desc')
|
||||||
->first();
|
->first();
|
||||||
|
|||||||
@@ -118,7 +118,8 @@ class ServiceSIMBG
|
|||||||
$importDatasource = ImportDatasource::create([
|
$importDatasource = ImportDatasource::create([
|
||||||
'status' => ImportDatasourceStatus::Processing->value,
|
'status' => ImportDatasourceStatus::Processing->value,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$initResToken = $this->getToken();
|
||||||
if (empty($initResToken->original['data']['token']['access'])) {
|
if (empty($initResToken->original['data']['token']['access'])) {
|
||||||
$importDatasource->update([
|
$importDatasource->update([
|
||||||
'status' => ImportDatasourceStatus::Failed->value,
|
'status' => ImportDatasourceStatus::Failed->value,
|
||||||
@@ -126,8 +127,6 @@ class ServiceSIMBG
|
|||||||
]);
|
]);
|
||||||
return $this->resError("Failed to retrieve token");
|
return $this->resError("Failed to retrieve token");
|
||||||
}
|
}
|
||||||
|
|
||||||
$initResToken = $this->getToken();
|
|
||||||
$apiToken = $initResToken->original['data']['token']['access'];
|
$apiToken = $initResToken->original['data']['token']['access'];
|
||||||
$headers = ['Authorization' => "Bearer " . $apiToken];
|
$headers = ['Authorization' => "Bearer " . $apiToken];
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use Illuminate\Http\Request;
|
|||||||
define('LARAVEL_START', microtime(true));
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
ini_set('max_execution_time',14400);
|
ini_set('max_execution_time',14400);
|
||||||
|
ini_set('memory_limit', '2G');
|
||||||
|
|
||||||
// Determine if the application is in maintenance mode...
|
// Determine if the application is in maintenance mode...
|
||||||
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
|
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
@extends('layouts.vertical', ['subtitle' => 'Data'])
|
@extends('layouts.vertical', ['subtitle' => 'PDAM'])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
@include('layouts.partials/page-title', ['title' => 'Data', 'subtitle' => 'Tata Ruang'])
|
@include('layouts.partials/page-title', ['title' => 'Data', 'subtitle' => 'PDAM'])
|
||||||
|
|
||||||
<x-toast-notification />
|
<x-toast-notification />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
Reference in New Issue
Block a user