From 3bfd6bbdd217c443a1a623f1b0d6155c88b1bd74 Mon Sep 17 00:00:00 2001 From: Afila Date: Thu, 17 Nov 2022 10:48:53 +0700 Subject: [PATCH 1/2] tambahkan data untuk di kirim --- app/Http/Controllers/Controller.php | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 389d3fbad..ede6b0240 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -64,10 +64,12 @@ class Controller extends BaseController protected $sebutan_wilayah; protected $sebutan_kepala_wilayah; protected $browser_title; + protected $umum; public function __construct() { $this->profil = Profil::first(); + $this->umum = DataUmum::first(); if (in_array($this->profil->provinsi_id, [91, 92])) { $this->sebutan_wilayah = 'Distrik'; @@ -103,29 +105,39 @@ public function __construct() protected function kirimTrack() { - if (config('app.demo') == true) { // jika posisi demo, matikan tracking - return; - } + // if (config('app.demo') == true) { // jika posisi demo, matikan tracking + // return; + // } - if (session('track') != null && session('track') == date('Y m d')) { - return; - } + // if (session('track') != null && session('track') == date('Y m d')) { + // return; + // } $host_pantau = config('app.host_pantau'); $data = [ 'url' => url('/'), 'versi' => config('app.version'), - 'jml_desa' => DataDesa::count(), + 'jumlah_desa' => DataDesa::count(), + 'desa' => DataDesa::select(['desa_id', 'nama', 'sebutan_desa', 'path', 'website'])->get(), + 'jumlahdesa_sinkronisasi' => DataDesa::count(), 'jumlah_penduduk' => Penduduk::where('status_dasar', 1)->count(), 'jumlah_keluarga' => Keluarga::count(), - 'peta_wilayah' => DataUmum::first()->path ?? '[[[[]]]]', + 'peta_wilayah' => $this->umum->path ?? '[[[[]]]]', + 'batas_wilayah' => [ + 'bts_wil_utara' => $this->umum->bts_wil_utara, + 'bts_wil_timur' => $this->umum->bts_wil_timur, + 'bts_wil_selatan' => $this->umum->bts_wil_selatan, + 'bts_wil_barat' => $this->umum->bts_wil_barat + ], 'sebutan_wilayah' => $this->sebutan_wilayah, + 'alamat' => $this->profil->alamat, 'kode_kecamatan' => $this->profil->kecamatan_id, 'kode_kabupaten' => $this->profil->kabupaten_id, 'kode_provinsi' => $this->profil->provinsi_id, 'nama_kecamatan' => $this->profil->nama_kecamatan, 'nama_kabupaten' => $this->profil->nama_kabupaten, 'nama_provinsi' => $this->profil->nama_provinsi, + 'nama_camat' => $this->profil->nama_camat ]; try { From 1431eaba2e00f4428034fe62b49bec0d8c4c61af Mon Sep 17 00:00:00 2001 From: Afila Date: Thu, 17 Nov 2022 20:48:29 +0700 Subject: [PATCH 2/2] Update Controller.php --- app/Http/Controllers/Controller.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index ede6b0240..4ecc731d6 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -105,13 +105,13 @@ public function __construct() protected function kirimTrack() { - // if (config('app.demo') == true) { // jika posisi demo, matikan tracking - // return; - // } + if (config('app.demo') == true) { // jika posisi demo, matikan tracking + return; + } - // if (session('track') != null && session('track') == date('Y m d')) { - // return; - // } + if (session('track') != null && session('track') == date('Y m d')) { + return; + } $host_pantau = config('app.host_pantau'); $data = [