Anticipazione miglioria su API impianti eliminati

This commit is contained in:
loviuz 2024-02-02 09:12:42 +01:00
parent 033fff9b00
commit 2bafa32b19
1 changed files with 11 additions and 1 deletions

View File

@ -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)