From 353a13fa386b7a5285e4be504217db6214e7275c Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Tue, 10 May 2022 14:40:02 +0200 Subject: [PATCH] Soft-Delete customer appointments when deleting a customer. --- application/models/Customers_model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/models/Customers_model.php b/application/models/Customers_model.php index 7008de7b..3223b7b1 100644 --- a/application/models/Customers_model.php +++ b/application/models/Customers_model.php @@ -208,6 +208,7 @@ class Customers_model extends EA_Model { else { $this->db->update('users', ['delete_datetime' => date('Y-m-d H:i:s')], ['id' => $customer_id]); + $this->db->update('appointments', ['delete_datetime' => date('Y-m-d H:i:s')], ['id_users_customer' => $customer_id, 'delete_datetime' => NULL]); } }