dbmsv4 init...3
This commit is contained in:
parent
99bdd4013d
commit
dff595bf71
@ -20,7 +20,7 @@ abstract class BaseSource extends DBMigration
|
||||
*/
|
||||
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_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 ?";
|
||||
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
|
||||
@ -536,8 +536,8 @@ CREATE TABLE `serverinfo` (
|
||||
`os` varchar(30) DEFAULT NULL,
|
||||
`title` varchar(50) NOT NULL,
|
||||
`price` int(11) NOT NULL,
|
||||
`manufactur_at` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '제조일',
|
||||
`format_at` timestamp NULL DEFAULT NULL COMMENT '포맷보류일',
|
||||
`manufactur_at` date NOT NULL,
|
||||
`format_at` date DEFAULT NULL,
|
||||
`status` varchar(20) NOT NULL DEFAULT 'available',
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
@ -762,4 +762,4 @@ UNLOCK TABLES;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!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
|
||||
|
||||
@ -536,8 +536,8 @@ CREATE TABLE `serverinfo` (
|
||||
`os` varchar(30) DEFAULT NULL,
|
||||
`title` varchar(50) NOT NULL,
|
||||
`price` int(11) NOT NULL,
|
||||
`manufactur_at` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '제조일',
|
||||
`format_at` timestamp NULL DEFAULT NULL COMMENT '포맷보류일',
|
||||
`manufactur_at` date NOT NULL,
|
||||
`format_at` date DEFAULT NULL,
|
||||
`status` varchar(20) NOT NULL DEFAULT 'available',
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
@ -762,4 +762,4 @@ UNLOCK TABLES;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!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
|
||||
|
||||
@ -53,10 +53,6 @@ class ServerHelper extends EquipmentHelper
|
||||
case 'price':
|
||||
$value = number_format($value) . "원";
|
||||
break;
|
||||
case 'manufactur_at':
|
||||
case 'format_at':
|
||||
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
||||
break;
|
||||
case 'part':
|
||||
$value = view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
||||
'serverinfo_uid' => $viewDatas['entity']->getPK(),
|
||||
|
||||
@ -13,11 +13,15 @@ class ServerCodeProcess implements MigrationProcessInterface
|
||||
}
|
||||
public function process(string $site, array $row, int $cnt): void
|
||||
{
|
||||
//server_use_status => y이면 사용중
|
||||
$temps = [];
|
||||
$temps['code'] = trim($row['server_code']);
|
||||
$temps['amount'] = trim($row['server_disuse_date']) === 'y' ? 0 : intval($row['server_cost']);
|
||||
$temps['status'] = trim($row['server_disuse_date']) === 'y' ? STATUS['AVAILABLE'] : STATUS['OCCUPIED'];
|
||||
if (!$this->db->table('codeinfo')->insert($temps)) {
|
||||
$temps['type'] = SERVER['TYPES']['NORMAL'];
|
||||
$temps['chassisinfo_uid'] = 1;
|
||||
$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']);
|
||||
}
|
||||
echo "{$cnt} -> {$temps['code']} SERVERCODE 완료.\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user