diff --git a/app/Database/dbmsv2_test1.sql b/app/Database/dbmsv2_test1.sql index bd3cc02..943eae8 100644 --- a/app/Database/dbmsv2_test1.sql +++ b/app/Database/dbmsv2_test1.sql @@ -391,7 +391,7 @@ CREATE TABLE `serverinfo` ( LOCK TABLES `serverinfo` WRITE; /*!40000 ALTER TABLE `serverinfo` DISABLE KEYS */; -INSERT INTO `serverinfo` VALUES (17,772,30,'250922-M1','HP','HP DL360 Gen6',300000,'2025-08-31 15:00:00','0000-00-00 00:00:00','occupied','2025-09-24 00:37:51','2025-09-22 02:19:25',NULL),(18,790,31,'250922-M18','HP','HP DL360 Gen7',400000,'2025-09-01 15:00:00',NULL,'occupied','2025-09-24 00:37:40','2025-09-22 02:21:51',NULL),(19,NULL,NULL,'250922-M19','HP','HP DL360 Gen8',500000,'2025-09-02 15:00:00',NULL,'available',NULL,'2025-09-22 02:22:14',NULL),(20,NULL,NULL,'250922-M20','HP','HP DL360 Gen9',600000,'2025-09-03 15:00:00',NULL,'available',NULL,'2025-09-22 02:22:39',NULL),(21,NULL,NULL,'250922-M21','HP','HP DL360 Gen10',700000,'2025-09-04 15:00:00',NULL,'available',NULL,'2025-09-22 02:23:08',NULL),(22,820,32,'250922-M22','HP','Hitach HA3000',800000,'2025-09-05 15:00:00','0000-00-00 00:00:00','occupied','2025-09-24 01:08:14','2025-09-22 02:23:36',NULL); +INSERT INTO `serverinfo` VALUES (17,772,30,'250922-M1','HP','HP DL360 Gen6',300000,'2025-08-31 15:00:00','0000-00-00 00:00:00','occupied','2025-09-24 00:37:51','2025-09-22 02:19:25',NULL),(18,790,31,'250922-M18','HP','HP DL360 Gen7',400000,'2025-09-01 15:00:00',NULL,'occupied','2025-09-24 00:37:40','2025-09-22 02:21:51',NULL),(19,NULL,NULL,'250922-M19','HP','HP DL360 Gen8',500000,'2025-09-02 15:00:00',NULL,'available',NULL,'2025-09-22 02:22:14',NULL),(20,NULL,NULL,'250922-M20','HP','HP DL360 Gen9',600000,'2025-09-03 15:00:00',NULL,'available',NULL,'2025-09-22 02:22:39',NULL),(21,NULL,NULL,'250922-M21','HP','HP DL360 Gen10',700000,'2025-09-04 15:00:00',NULL,'available',NULL,'2025-09-22 02:23:08',NULL),(22,820,32,'250922-M22','HP','Hitach HA3000',5000000,'2025-09-05 15:00:00','0000-00-00 00:00:00','occupied','2025-09-24 01:34:18','2025-09-22 02:23:36',NULL); /*!40000 ALTER TABLE `serverinfo` ENABLE KEYS */; UNLOCK TABLES; @@ -602,4 +602,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2025-09-24 10:08:42 +-- Dump completed on 2025-09-24 11:00:23 diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php index a8efd0e..ae661c3 100644 --- a/app/Services/CommonService.php +++ b/app/Services/CommonService.php @@ -335,15 +335,14 @@ abstract class CommonService { try { $message = "[{$entity->getTitle()}]" . MESSAGES["DELETED"] . ":"; - $result = $this->getModel()->delete($entity->getPK()); - if (!$result) { - throw new \Exception($message); + if (!$this->getModel()->delete($entity->getPK())) { + throw new \Exception(var_export($this->getModel()->errors(), true)); } // LogCollector::info($message); return $entity; } catch (\Exception $e) { $message = sprintf( - "\n------%s SQL오류-----
\n%s
\n%s
\n------------------------------\n", + "\n------%s SQL오류-----\n%s\n%s\n------------------------------\n", __FUNCTION__, $this->getModel()->getLastQuery(), $e->getMessage() diff --git a/app/Services/Customer/ServiceService.php b/app/Services/Customer/ServiceService.php index cf0bcf9..ca751c1 100644 --- a/app/Services/Customer/ServiceService.php +++ b/app/Services/Customer/ServiceService.php @@ -277,8 +277,8 @@ class ServiceService extends CustomerService //삭제 public function delete(mixed $entity): ServiceEntity { - $entity = parent::delete($entity); - //후처리작업 - return $this->action_process($entity, __FUNCTION__ . 'Service'); + //선처리작업 + $this->action_process($entity, __FUNCTION__ . 'Service'); + return parent::delete($entity); } } diff --git a/app/Services/Equipment/ServerPartService.php b/app/Services/Equipment/ServerPartService.php index ed298d5..ba86250 100644 --- a/app/Services/Equipment/ServerPartService.php +++ b/app/Services/Equipment/ServerPartService.php @@ -299,9 +299,8 @@ class ServerPartService extends EquipmentService //삭제 public function delete(mixed $entity): ServerPartEntity { - $entity = parent::delete($entity); - //후처리작업 + //선처리작업 $entity = $this->action_process($entity, __FUNCTION__ . 'ServerPart'); - return $entity; + return parent::delete($entity); } } diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 6007bec..bb94468 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -138,9 +138,9 @@ class ServerService extends EquipmentService //삭제 public function delete(mixed $entity): ServerEntity { - $entity = parent::delete($entity); - //후처리작업 - return $this->action_process($entity, __FUNCTION__ . 'Server'); + //선처리작업 + $entity = $this->action_process($entity, __FUNCTION__ . 'Server'); + return parent::delete($entity); } //List 검색용 //OrderBy 처리