diff --git a/app/Imports/SinkronPenduduk.php b/app/Imports/SinkronPenduduk.php index 1eae7e5fa..1b1bdb2fd 100644 --- a/app/Imports/SinkronPenduduk.php +++ b/app/Imports/SinkronPenduduk.php @@ -122,8 +122,8 @@ public function collection(Collection $collection) ]; Penduduk::updateOrInsert([ - 'desa_id' => $insert['desa_id'], - 'nik' => $insert['nik'] + 'desa_id' => $insert['desa_id'], + 'id_pend_desa' => $insert['id_pend_desa'], ], $insert); } diff --git a/catatan_rilis.md b/catatan_rilis.md index 6e2ffeb05..cf305f34a 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -14,8 +14,8 @@ Di rilis v23.03.01 berisi perbaikan yang diminta Komunitas OpenDK. #### Perbaikan bug -1. [#638](https://github.com/OpenSID/OpenDK/issues/638) Perbaiki slider tidak bisa lebih dari 4. - +1. [#638](https://github.com/OpenSID/OpenDK/issues/638) Perbaikan slider tidak bisa lebih dari 4. +2. [#652](https://github.com/OpenSID/OpenDK/issues/652) Perbaikan jumlah penduduk tidak sinkron antara kecamatan dan desa karena perubahan NIK (kasus tertentu). #### Teknis @@ -25,4 +25,4 @@ Di rilis v23.03.01 berisi perbaikan yang diminta Komunitas OpenDK. 4. [#2116](https://github.com/OpenSID/premium/issues/2116) Audit keamanan form potensi. 5. [#2118](https://github.com/OpenSID/premium/issues/2118) Audit keamanan form dokumen. 6. [#2121](https://github.com/OpenSID/premium/issues/2121) Audit keamanan form pengurus. -7. [#2124](https://github.com/OpenSID/premium/issues/2124) Audit keamanan form keluhan. +7. [#2124](https://github.com/OpenSID/premium/issues/2124) Audit keamanan form keluhan. \ No newline at end of file diff --git a/composer.json b/composer.json index a1a5cda4c..58c0191b9 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,7 @@ "beyondcode/laravel-query-detector": "^1.5", "fakerphp/faker": "^1.10", "filp/whoops": "~2.0", - "friendsofphp/php-cs-fixer": "^3.0", + "friendsofphp/php-cs-fixer": "^3.9", "laravel/tinker": "^2.5", "mockery/mockery": "^1.3.1", "phpunit/phpunit": "^8.5", @@ -72,7 +72,8 @@ "preferred-install": "dist", "sort-packages": true, "allow-plugins": { - "symfony/thanks": true + "symfony/thanks": true, + "php-http/discovery": true } }, "extra": { diff --git a/database/migrations/2023_03_29_224214_delete_duplicate_penduduk.php b/database/migrations/2023_03_29_224214_delete_duplicate_penduduk.php new file mode 100644 index 000000000..bc6064b1b --- /dev/null +++ b/database/migrations/2023_03_29_224214_delete_duplicate_penduduk.php @@ -0,0 +1,66 @@ +select('id_pend_desa', 'desa_id', DB::raw('COUNT(*) as `count`')) + ->groupBy('id_pend_desa', 'desa_id') + ->having('count', '>', 1) + ->get(); + + foreach ($duplicates as $duplicate) { + $penduduk = Penduduk::where('id_pend_desa', $duplicate->id_pend_desa)->where('desa_id', $duplicate->desa_id)->latest('updated_at')->first('id'); + Penduduk::where('id_pend_desa', $duplicate->id_pend_desa)->where('desa_id', $duplicate->desa_id)->where('id', '!=', $penduduk->id)->delete(); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}