dbmsv4 init...3

This commit is contained in:
최준흠 2025-12-23 10:26:16 +09:00
parent 99bdd4013d
commit dff595bf71
5 changed files with 14 additions and 14 deletions

View File

@ -20,7 +20,7 @@ abstract class BaseSource extends DBMigration
*/ */
private const SQL_GET_CLIENT = "SELECT * FROM clientdb"; private const SQL_GET_CLIENT = "SELECT * FROM clientdb";
private const SQL_GET_LINE = "SELECT Line_code, line_case, Line_ip, line_client_name, line_gateway, line_id, line_pass, line_name, line_haveip, line_phone, line_mainip FROM linedb"; private const SQL_GET_LINE = "SELECT Line_code, line_case, Line_ip, line_client_name, line_gateway, line_id, line_pass, line_name, line_haveip, line_phone, line_mainip FROM linedb";
private const SQL_GET_SERVER_CODE = "SELECT DISTINCT(server_code) FROM serverdb WHERE server_code NOT LIKE ?"; private const SQL_GET_SERVER_CODE = "SELECT server_code,server_use_status,server_cost,server_release_date FROM serverdb WHERE server_code NOT LIKE ?";
private const SQL_GET_SWITCH_CODE = "SELECT DISTINCT(service_sw) FROM servicedb WHERE service_sw NOT LIKE ?"; private const SQL_GET_SWITCH_CODE = "SELECT DISTINCT(service_sw) FROM servicedb WHERE service_sw NOT LIKE ?";
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)

View File

@ -536,8 +536,8 @@ CREATE TABLE `serverinfo` (
`os` varchar(30) DEFAULT NULL, `os` varchar(30) DEFAULT NULL,
`title` varchar(50) NOT NULL, `title` varchar(50) NOT NULL,
`price` int(11) NOT NULL, `price` int(11) NOT NULL,
`manufactur_at` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '제조일', `manufactur_at` date NOT NULL,
`format_at` timestamp NULL DEFAULT NULL COMMENT '포맷보류일', `format_at` date DEFAULT NULL,
`status` varchar(20) NOT NULL DEFAULT 'available', `status` varchar(20) NOT NULL DEFAULT 'available',
`updated_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
@ -762,4 +762,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2025-12-22 17:26:46 -- Dump completed on 2025-12-23 10:12:24

View File

@ -536,8 +536,8 @@ CREATE TABLE `serverinfo` (
`os` varchar(30) DEFAULT NULL, `os` varchar(30) DEFAULT NULL,
`title` varchar(50) NOT NULL, `title` varchar(50) NOT NULL,
`price` int(11) NOT NULL, `price` int(11) NOT NULL,
`manufactur_at` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '제조일', `manufactur_at` date NOT NULL,
`format_at` timestamp NULL DEFAULT NULL COMMENT '포맷보류일', `format_at` date DEFAULT NULL,
`status` varchar(20) NOT NULL DEFAULT 'available', `status` varchar(20) NOT NULL DEFAULT 'available',
`updated_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
@ -762,4 +762,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2025-12-22 17:26:54 -- Dump completed on 2025-12-23 10:12:15

View File

@ -53,10 +53,6 @@ class ServerHelper extends EquipmentHelper
case 'price': case 'price':
$value = number_format($value) . ""; $value = number_format($value) . "";
break; break;
case 'manufactur_at':
case 'format_at':
$value = $value ? date("Y-m-d", strtotime($value)) : "";
break;
case 'part': case 'part':
$value = view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [ $value = view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
'serverinfo_uid' => $viewDatas['entity']->getPK(), 'serverinfo_uid' => $viewDatas['entity']->getPK(),

View File

@ -13,11 +13,15 @@ class ServerCodeProcess implements MigrationProcessInterface
} }
public function process(string $site, array $row, int $cnt): void public function process(string $site, array $row, int $cnt): void
{ {
//server_use_status => y이면 사용중
$temps = []; $temps = [];
$temps['code'] = trim($row['server_code']); $temps['code'] = trim($row['server_code']);
$temps['amount'] = trim($row['server_disuse_date']) === 'y' ? 0 : intval($row['server_cost']); $temps['type'] = SERVER['TYPES']['NORMAL'];
$temps['status'] = trim($row['server_disuse_date']) === 'y' ? STATUS['AVAILABLE'] : STATUS['OCCUPIED']; $temps['chassisinfo_uid'] = 1;
if (!$this->db->table('codeinfo')->insert($temps)) { $temps['price'] = trim($row['server_use_status']) === 'y' ? 0 : intval($row['server_cost']);
$temps['status'] = trim($row['server_use_status']) === 'y' ? STATUS['AVAILABLE'] : STATUS['OCCUPIED'];
$temps['manufactur_at'] = trim($row['server_release_date']);
if (!$this->db->table('serverinfo')->insert($temps)) {
throw new \Exception($this->db->error()['message']); throw new \Exception($this->db->error()['message']);
} }
echo "{$cnt} -> {$temps['code']} SERVERCODE 완료.\n"; echo "{$cnt} -> {$temps['code']} SERVERCODE 완료.\n";