From 2bafa32b195d5b4e0a67d968c7762c957b5ab317 Mon Sep 17 00:00:00 2001 From: loviuz Date: Fri, 2 Feb 2024 09:12:42 +0100 Subject: [PATCH] Anticipazione miglioria su API impianti eliminati --- src/API/App/v1/Impianti.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/API/App/v1/Impianti.php b/src/API/App/v1/Impianti.php index f2372df4d..9383c458a 100755 --- a/src/API/App/v1/Impianti.php +++ b/src/API/App/v1/Impianti.php @@ -27,7 +27,17 @@ class Impianti extends AppResource { public function getCleanupData($last_sync_at) { - return $this->getMissingIDs('my_impianti', 'id', $last_sync_at); + // TODO: modificare introducendo deleted_at su my_impianti + return database() + ->table('zz_operations') + ->select('id_record') + ->distinct() + ->join('zz_modules', 'zz_modules.id', '=', 'zz_operations.id_module') + ->where('zz_modules.name', '=', 'Impianti') + ->where('zz_operations.op', '=', 'delete') + ->where('zz_operations.created_at', '>', $last_sync_at) + ->pluck('id_record') + ->toArray(); } public function getModifiedRecords($last_sync_at)