add backup success sync

This commit is contained in:
arifal hidayat
2025-08-08 00:12:22 +07:00
parent 3902a486f7
commit 588e3ad5e2
7 changed files with 37715 additions and 19 deletions

View File

@@ -3,11 +3,12 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Models\PbgTask; use App\Models\PbgTask;
use App\Models\PbgTaskAttachment;
use App\Models\PbgTaskDetail; use App\Models\PbgTaskDetail;
use App\Models\PbgTaskIndexIntegrations;
use App\Models\PbgTaskPrasarana;
use App\Models\PbgTaskRetributions; use App\Models\PbgTaskRetributions;
use DB;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class TruncatePBGTable extends Command class TruncatePBGTable extends Command
{ {
@@ -32,9 +33,10 @@ class TruncatePBGTable extends Command
{ {
DB::statement('SET FOREIGN_KEY_CHECKS=0;'); DB::statement('SET FOREIGN_KEY_CHECKS=0;');
PbgTask::truncate(); PbgTask::truncate();
PbgTaskAttachment::truncate();
PbgTaskRetributions::truncate(); PbgTaskRetributions::truncate();
PbgTaskDetail::truncate(); PbgTaskDetail::truncate();
PbgTaskIndexIntegrations::truncate();
PbgTaskPrasarana::truncate();
DB::statement('SET FOREIGN_KEY_CHECKS=1;'); DB::statement('SET FOREIGN_KEY_CHECKS=1;');
} }
} }

View File

@@ -11,7 +11,7 @@ use Barryvdh\DomPDF\Facade\Pdf;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Exception; use Exception;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Log; use Illuminate\Support\Facades\Log;
use Maatwebsite\Excel\Facades\Excel; use Maatwebsite\Excel\Facades\Excel;
class RequestAssignmentController extends Controller class RequestAssignmentController extends Controller
@@ -24,8 +24,7 @@ class RequestAssignmentController extends Controller
$query = PbgTask::with([ $query = PbgTask::with([
'attachments' => function ($q) { 'attachments' => function ($q) {
$q->whereIn('pbg_type', ['berita_acara', 'bukti_bayar']); $q->whereIn('pbg_type', ['berita_acara', 'bukti_bayar']);
}, }
'googleSheet'
])->orderBy('id', 'desc'); ])->orderBy('id', 'desc');
if ($request->has('filter') && !empty($request->get('filter'))) { if ($request->has('filter') && !empty($request->get('filter'))) {
@@ -36,10 +35,8 @@ class RequestAssignmentController extends Controller
$query->where(function ($q) { $query->where(function ($q) {
$q->where(function ($q2) { $q->where(function ($q2) {
$q2->whereRaw("LOWER(function_type) != ?", ['sebagai tempat usaha']) $q2->whereRaw("LOWER(function_type) != ?", ['sebagai tempat usaha'])
->whereRaw("status != ?", 20)
->orWhereNull('function_type'); ->orWhereNull('function_type');
})
->whereDoesntHave('googleSheet', function ($sub) {
$sub->whereRaw("LOWER(status_verifikasi) = ?", ['selesai verifikasi']);
}); });
}); });
break; break;
@@ -47,24 +44,17 @@ class RequestAssignmentController extends Controller
case 'business': case 'business':
$query->where(function ($q) { $query->where(function ($q) {
$q->whereRaw("LOWER(function_type) = ?", ['sebagai tempat usaha']) $q->whereRaw("LOWER(function_type) = ?", ['sebagai tempat usaha'])
->whereDoesntHave('googleSheet', function ($sub) { ->whereRaw("status != ?", 20);
$sub->whereRaw("LOWER(status_verifikasi) = ?", ['selesai verifikasi']);
});
}); });
break; break;
case 'verified': case 'verified':
$query->whereHas('googleSheet', function ($q) { $query->whereRaw("status = ?", 20);
$q->whereRaw("LOWER(status_verifikasi) = ?", ['selesai verifikasi']);
});
break; break;
case 'non-verified': case 'non-verified':
$query->where(function ($q) { $query->where(function ($q) {
$q->whereDoesntHave('googleSheet') $q->whereRaw("status != ?", 20);
->orWhereHas('googleSheet', function ($q2) {
$q2->whereRaw("LOWER(status_verifikasi) != ?", ['selesai verifikasi'])->orWhereNull('status_verifikasi');
});
}); });
break; break;
} }

7779
pbg_task.sql Normal file

File diff suppressed because it is too large Load Diff

6336
pbg_task_details.sql Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

11491
pbg_task_prasarana.sql Normal file

File diff suppressed because it is too large Load Diff

4601
pbg_task_retributions.sql Normal file

File diff suppressed because it is too large Load Diff