dbmsv2 init...1
This commit is contained in:
parent
860cce5dbc
commit
e5d3f0bb10
@ -384,7 +384,8 @@ define('SERVICE_UNPAID_ITEM_TYPE', $_ENV['SERVICE_UNPAID_ITEM_TYPE'] ?? $_SERVER
|
||||
define(
|
||||
'SITE_PREFIX',
|
||||
[
|
||||
'Client' => $_ENV['PREFIX_Client'] ?? $_SERVER['PREFIX_Client'] ?? 'C',
|
||||
'Service' => $_ENV['PREFIX_Service'] ?? $_SERVER['PREFIX_Service'] ?? 'S'
|
||||
'prime' => $_ENV['PREFIX_Client'] ?? $_SERVER['PREFIX_Client'] ?? 'PR',
|
||||
'itsolution' => $_ENV['PREFIX_Client'] ?? $_SERVER['PREFIX_Client'] ?? 'IT',
|
||||
'gdidc' => $_ENV['PREFIX_Client'] ?? $_SERVER['PREFIX_Client'] ?? 'GD',
|
||||
],
|
||||
);
|
||||
|
||||
@ -1,18 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Admin\Equipment\Part;
|
||||
|
||||
use App\Controllers\Admin\Equipment\EquipmentController;
|
||||
namespace App\Controllers\Admin\Equipment;
|
||||
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
abstract class PartController extends EquipmentController
|
||||
use App\Helpers\Equipment\PartHelper;
|
||||
use App\Services\Equipment\PartService;
|
||||
|
||||
class PartController extends EquipmentController
|
||||
{
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->content_title = lang("{$this->getService()->getClassName()}.title");
|
||||
$this->class_path .= $this->getService()->getClassName();
|
||||
$this->uri_path .= strtolower($this->getService()->getClassName('/')) . '/';
|
||||
// $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
|
||||
|
||||
}
|
||||
//Index,FieldForm관련
|
||||
public function getService(): PartService
|
||||
{
|
||||
if (!$this->_service) {
|
||||
$this->_service = new PartService();
|
||||
}
|
||||
return $this->_service;
|
||||
}
|
||||
public function getHelper(): PartHelper
|
||||
{
|
||||
if (!$this->_helper) {
|
||||
$this->_helper = new PartHelper();
|
||||
}
|
||||
return $this->_helper;
|
||||
}
|
||||
//Index,FieldForm관
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ class ServerController extends EquipmentController
|
||||
foreach (SERVICE_ITEM_TYPES as $item_type => $label) {
|
||||
$entity->setItemEntities(
|
||||
$item_type,
|
||||
$this->getService()->getEntities(['serviceinfo_code' => $entity->getPK(), 'item_type' => $item_type])
|
||||
$this->getService()->getEntities(['serviceinfo_uid' => $entity->getPK(), 'item_type' => $item_type])
|
||||
);
|
||||
}
|
||||
//부모처리
|
||||
|
||||
@ -36,7 +36,7 @@ class Payment extends BaseController
|
||||
//결제일이 오늘보다 크고, 상태가 사용중인 서비스정보를 이용해서 결제정보에 신규 추가하기
|
||||
foreach ($this->getServiceService()->getEntities(['billing_at' => date("Y-m-d"), 'status' => ServiceEntity::STATUS_NORMAL]) as $serviceEntity) {
|
||||
// echo $serviceEntity->getPK() . ":" . $serviceEntity->getBillingAt() . "\n";
|
||||
foreach ($this->getServiceItemService()->getEntities(['serviceinfo_code' => $serviceEntity->getPK()]) as $itemEntity) {
|
||||
foreach ($this->getServiceItemService()->getEntities(['serviceinfo_uid' => $serviceEntity->getPK()]) as $itemEntity) {
|
||||
//결제정보 ServicePaymentService에 월별 결제만 신규등록
|
||||
if ($itemEntity->getBillingCycle() == "month") {
|
||||
//결제정보 ServicePaymentService에 등록
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -25,7 +25,7 @@ DROP TABLE IF EXISTS `accountinfo`;
|
||||
CREATE TABLE `accountinfo` (
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`user_uid` int(11) NOT NULL COMMENT '관리자정보',
|
||||
`clientinfo_code` varchar(20) NOT NULL COMMENT '고객코드',
|
||||
`clientinfo_uid` int(11) NOT NULL COMMENT '고객정보',
|
||||
`bank` int(11) NOT NULL COMMENT '은행',
|
||||
`title` varchar(255) NOT NULL COMMENT '사유',
|
||||
`alias` varchar(50) NOT NULL COMMENT '입출금자명',
|
||||
@ -37,8 +37,8 @@ CREATE TABLE `accountinfo` (
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`uid`),
|
||||
KEY `FK_user_TO_accountinfo` (`user_uid`),
|
||||
KEY `FK_clientinfo_TO_accountinfo` (`clientinfo_code`),
|
||||
CONSTRAINT `FK_clientinfo_TO_accountinfo` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
|
||||
KEY `FK_clientinfo_TO_accountinfo` (`clientinfo_uid`),
|
||||
CONSTRAINT `FK_clientinfo_TO_accountinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
|
||||
CONSTRAINT `FK_user_TO_accountinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='예치금계좌';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@ -60,8 +60,10 @@ DROP TABLE IF EXISTS `clientinfo`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `clientinfo` (
|
||||
`code` varchar(20) NOT NULL COMMENT '고객코드',
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '고객정보',
|
||||
`user_uid` int(11) NOT NULL COMMENT '관리자정보',
|
||||
`code` varchar(20) NOT NULL COMMENT '고객코드',
|
||||
`site` varchar(20) NOT NULL DEFAULT 'prime' COMMENT 'Site구분',
|
||||
`role` varchar(50) NOT NULL DEFAULT 'user',
|
||||
`name` varchar(100) NOT NULL,
|
||||
`phone` varchar(50) DEFAULT NULL,
|
||||
@ -74,7 +76,8 @@ CREATE TABLE `clientinfo` (
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`code`),
|
||||
PRIMARY KEY (`uid`),
|
||||
UNIQUE KEY `UQ_code` (`code`),
|
||||
UNIQUE KEY `UQ_name` (`name`),
|
||||
KEY `FK_user_TO_clientinfo` (`user_uid`),
|
||||
CONSTRAINT `FK_user_TO_clientinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
|
||||
@ -100,7 +103,7 @@ DROP TABLE IF EXISTS `couponinfo`;
|
||||
CREATE TABLE `couponinfo` (
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`user_uid` int(11) NOT NULL COMMENT '관리자정보',
|
||||
`clientinfo_code` varchar(20) NOT NULL COMMENT '고객코드',
|
||||
`clientinfo_uid` int(11) NOT NULL COMMENT '고객정보',
|
||||
`title` varchar(255) NOT NULL,
|
||||
`cnt` int(11) NOT NULL DEFAULT 0 COMMENT '갯수',
|
||||
`status` varchar(20) NOT NULL DEFAULT 'deposit',
|
||||
@ -109,8 +112,8 @@ CREATE TABLE `couponinfo` (
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`uid`),
|
||||
KEY `FK_user_TO_couponinfo` (`user_uid`),
|
||||
KEY `FK_clientinfo_TO_couponinfo` (`clientinfo_code`),
|
||||
CONSTRAINT `FK_clientinfo_TO_couponinfo` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
|
||||
KEY `FK_clientinfo_TO_couponinfo` (`clientinfo_uid`),
|
||||
CONSTRAINT `FK_clientinfo_TO_couponinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
|
||||
CONSTRAINT `FK_user_TO_couponinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='쿠폰정보';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@ -133,7 +136,7 @@ DROP TABLE IF EXISTS `csinfo`;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `csinfo` (
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`serverinfo_code` varchar(20) DEFAULT NULL COMMENT '서버코드',
|
||||
`serverinfo_uid` int(11) DEFAULT NULL COMMENT '서버정보',
|
||||
`type` varchar(20) NOT NULL COMMENT '구분(KCS,VCS)',
|
||||
`ip` varchar(50) NOT NULL,
|
||||
`accountid` varchar(50) DEFAULT NULL,
|
||||
@ -145,8 +148,8 @@ CREATE TABLE `csinfo` (
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`uid`),
|
||||
UNIQUE KEY `UQ_ip` (`ip`),
|
||||
KEY `FK_serverinfo_TO_csinfo` (`serverinfo_code`),
|
||||
CONSTRAINT `FK_serverinfo_TO_csinfo` FOREIGN KEY (`serverinfo_code`) REFERENCES `serverinfo` (`code`)
|
||||
KEY `FK_serverinfo_TO_csinfo` (`serverinfo_uid`),
|
||||
CONSTRAINT `FK_serverinfo_TO_csinfo` FOREIGN KEY (`serverinfo_uid`) REFERENCES `serverinfo` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='CS정보(한서버 여러개 앞단 등록가능)';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
@ -167,10 +170,10 @@ DROP TABLE IF EXISTS `ipinfo`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `ipinfo` (
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'IP정보',
|
||||
`lineinfo_uid` int(11) NOT NULL COMMENT '회선정보',
|
||||
`clientinfo_code` varchar(20) DEFAULT NULL COMMENT '고객코드(직전고객)',
|
||||
`serverinfo_code` varchar(20) DEFAULT NULL COMMENT '서버코드',
|
||||
`clientinfo_uid` int(11) DEFAULT NULL COMMENT '고객정보',
|
||||
`serverinfo_uid` int(11) DEFAULT NULL COMMENT '서버정보',
|
||||
`ip` char(16) NOT NULL,
|
||||
`price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
|
||||
`history` text DEFAULT NULL COMMENT 'history',
|
||||
@ -181,12 +184,12 @@ CREATE TABLE `ipinfo` (
|
||||
PRIMARY KEY (`uid`),
|
||||
UNIQUE KEY `UQ_ip` (`ip`),
|
||||
KEY `FK_lineinfo_TO_ipinfo` (`lineinfo_uid`),
|
||||
KEY `FK_serverinfo_TO_ipinfo` (`serverinfo_code`),
|
||||
KEY `FK_clientinfo_TO_ipinfo` (`clientinfo_code`),
|
||||
CONSTRAINT `FK_clientinfo_TO_ipinfo` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
|
||||
KEY `FK_clientinfo_TO_ipinfo` (`clientinfo_uid`),
|
||||
KEY `FK_serverinfo_TO_ipinfo` (`serverinfo_uid`),
|
||||
CONSTRAINT `FK_clientinfo_TO_ipinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
|
||||
CONSTRAINT `FK_lineinfo_TO_ipinfo` FOREIGN KEY (`lineinfo_uid`) REFERENCES `lineinfo` (`uid`),
|
||||
CONSTRAINT `FK_serverinfo_TO_ipinfo` FOREIGN KEY (`serverinfo_code`) REFERENCES `serverinfo` (`code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=' IP 정보';
|
||||
CONSTRAINT `FK_serverinfo_TO_ipinfo` FOREIGN KEY (`serverinfo_uid`) REFERENCES `serverinfo` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=' IP정보';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
@ -206,7 +209,7 @@ DROP TABLE IF EXISTS `lineinfo`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `lineinfo` (
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '회선정보',
|
||||
`type` varchar(20) NOT NULL COMMENT '회선구분',
|
||||
`title` varchar(100) NOT NULL,
|
||||
`bandwith` varchar(20) NOT NULL COMMENT 'IP 대역',
|
||||
@ -218,7 +221,7 @@ CREATE TABLE `lineinfo` (
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`uid`),
|
||||
UNIQUE KEY `UQ_title` (`title`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='회선 정보';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='회선정보';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
@ -238,7 +241,7 @@ DROP TABLE IF EXISTS `partinfo`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `partinfo` (
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'PART정보',
|
||||
`type` enum('CPU','RAM','DISK','SOFTWARE') NOT NULL COMMENT '형식',
|
||||
`title` varchar(50) NOT NULL,
|
||||
`price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
|
||||
@ -270,8 +273,8 @@ DROP TABLE IF EXISTS `payment`;
|
||||
CREATE TABLE `payment` (
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`user_uid` int(11) NOT NULL COMMENT '관리자정보',
|
||||
`clientinfo_code` varchar(20) NOT NULL COMMENT '고객코드',
|
||||
`serviceinfo_code` varchar(20) NOT NULL COMMENT '서비스코드',
|
||||
`clientinfo_uid` int(11) NOT NULL COMMENT '고객정보',
|
||||
`serviceinfo_uid` int(11) NOT NULL COMMENT '서비스정보',
|
||||
`title` varchar(50) NOT NULL COMMENT '청구 내용(제품명)',
|
||||
`amount` int(11) NOT NULL DEFAULT 0 COMMENT '청구금액',
|
||||
`billing_method` varchar(20) NOT NULL COMMENT '청구방법(month,onetime)',
|
||||
@ -283,10 +286,10 @@ CREATE TABLE `payment` (
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`uid`),
|
||||
KEY `FK_user_TO_payment` (`user_uid`),
|
||||
KEY `FK_serviceinfo_TO_payment` (`serviceinfo_code`),
|
||||
KEY `FK_clientinfo_TO_payment` (`clientinfo_code`),
|
||||
CONSTRAINT `FK_clientinfo_TO_payment` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
|
||||
CONSTRAINT `FK_serviceinfo_TO_payment` FOREIGN KEY (`serviceinfo_code`) REFERENCES `serviceinfo` (`code`),
|
||||
KEY `FK_clientinfo_TO_payment` (`clientinfo_uid`),
|
||||
KEY `FK_serviceinfo_TO_payment` (`serviceinfo_uid`),
|
||||
CONSTRAINT `FK_clientinfo_TO_payment` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
|
||||
CONSTRAINT `FK_serviceinfo_TO_payment` FOREIGN KEY (`serviceinfo_uid`) REFERENCES `serviceinfo` (`uid`),
|
||||
CONSTRAINT `FK_user_TO_payment` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='결제정보';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@ -310,7 +313,7 @@ DROP TABLE IF EXISTS `pointinfo`;
|
||||
CREATE TABLE `pointinfo` (
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`user_uid` int(11) NOT NULL COMMENT '관리자정보',
|
||||
`clientinfo_code` varchar(20) NOT NULL COMMENT '고객코드',
|
||||
`clientinfo_uid` int(11) NOT NULL COMMENT '고객정보',
|
||||
`title` varchar(255) NOT NULL,
|
||||
`amount` int(11) NOT NULL DEFAULT 0 COMMENT '포인트액',
|
||||
`status` varchar(20) NOT NULL DEFAULT 'deposit',
|
||||
@ -319,8 +322,8 @@ CREATE TABLE `pointinfo` (
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`uid`),
|
||||
KEY `FK_user_TO_pointinfo` (`user_uid`),
|
||||
KEY `FK_clientinfo_TO_pointinfo` (`clientinfo_code`),
|
||||
CONSTRAINT `FK_clientinfo_TO_pointinfo` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
|
||||
KEY `FK_clientinfo_TO_pointinfo` (`clientinfo_uid`),
|
||||
CONSTRAINT `FK_clientinfo_TO_pointinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
|
||||
CONSTRAINT `FK_user_TO_pointinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='포인트정보';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@ -342,9 +345,10 @@ DROP TABLE IF EXISTS `serverinfo`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `serverinfo` (
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '서버정보',
|
||||
`clientinfo_uid` int(11) DEFAULT NULL COMMENT '고객정보',
|
||||
`serviceinfo_uid` int(11) DEFAULT NULL COMMENT '서비스정보',
|
||||
`code` varchar(20) NOT NULL COMMENT '서버코드',
|
||||
`clientinfo_code` varchar(20) DEFAULT NULL COMMENT '고객코드(소유주)',
|
||||
`serviceinfo_code` varchar(20) DEFAULT NULL COMMENT '서비스코드',
|
||||
`type` varchar(20) NOT NULL COMMENT '구분(밴더등)',
|
||||
`title` varchar(50) NOT NULL,
|
||||
`price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
|
||||
@ -355,11 +359,12 @@ CREATE TABLE `serverinfo` (
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`code`),
|
||||
KEY `FK_serviceinfo_TO_serverinfo` (`serviceinfo_code`),
|
||||
KEY `FK_clientinfo_TO_serverinfo` (`clientinfo_code`),
|
||||
CONSTRAINT `FK_clientinfo_TO_serverinfo` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
|
||||
CONSTRAINT `FK_serviceinfo_TO_serverinfo` FOREIGN KEY (`serviceinfo_code`) REFERENCES `serviceinfo` (`code`)
|
||||
PRIMARY KEY (`uid`),
|
||||
UNIQUE KEY `UQ_code` (`code`),
|
||||
KEY `FK_serviceinfo_TO_serverinfo` (`serviceinfo_uid`),
|
||||
KEY `FK_clientinfo_TO_serverinfo` (`clientinfo_uid`),
|
||||
CONSTRAINT `FK_clientinfo_TO_serverinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
|
||||
CONSTRAINT `FK_serviceinfo_TO_serverinfo` FOREIGN KEY (`serviceinfo_uid`) REFERENCES `serviceinfo` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='서버정보';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
@ -381,18 +386,18 @@ DROP TABLE IF EXISTS `serverinfo_partinfo`;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `serverinfo_partinfo` (
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`serverinfo_code` varchar(20) NOT NULL COMMENT '서버코드',
|
||||
`partinfo_uid` int(11) NOT NULL COMMENT 'part정보',
|
||||
`serverinfo_uid` int(11) NOT NULL COMMENT '서버정보',
|
||||
`partinfo_uid` int(11) NOT NULL COMMENT 'PART정보',
|
||||
`billing_method` varchar(20) NOT NULL COMMENT '청구방법(month,onetime)',
|
||||
`cnt` tinyint(4) NOT NULL DEFAULT 1 COMMENT '갯수',
|
||||
`extra` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '추가정보(RAID등)',
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (`uid`),
|
||||
KEY `FK_serverinfo_TO_serverinfo_partinfo` (`serverinfo_code`),
|
||||
KEY `FK_partinfo_TO_serverinfo_partinfo` (`partinfo_uid`),
|
||||
KEY `FK_serverinfo_TO_serverinfo_partinfo` (`serverinfo_uid`),
|
||||
CONSTRAINT `FK_partinfo_TO_serverinfo_partinfo` FOREIGN KEY (`partinfo_uid`) REFERENCES `partinfo` (`uid`),
|
||||
CONSTRAINT `FK_serverinfo_TO_serverinfo_partinfo` FOREIGN KEY (`serverinfo_code`) REFERENCES `serverinfo` (`code`)
|
||||
CONSTRAINT `FK_serverinfo_TO_serverinfo_partinfo` FOREIGN KEY (`serverinfo_uid`) REFERENCES `serverinfo` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='서버정보_part정보(CASECADE)';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
@ -413,9 +418,10 @@ DROP TABLE IF EXISTS `serviceinfo`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `serviceinfo` (
|
||||
`code` varchar(20) NOT NULL COMMENT '서비스코드',
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '서비스정보',
|
||||
`user_uid` int(11) NOT NULL COMMENT '관리자정보',
|
||||
`clientinfo_code` varchar(20) NOT NULL COMMENT '고객코드',
|
||||
`clientinfo_uid` int(11) NOT NULL COMMENT '고객정보',
|
||||
`code` varchar(20) NOT NULL COMMENT '서비스코드',
|
||||
`type` varchar(20) NOT NULL COMMENT '서비스형식((일반, 자사,코로케이션 등)',
|
||||
`location` varchar(20) DEFAULT NULL COMMENT '지역코드(chiba,tokyo,3center등)',
|
||||
`billing_at` date NOT NULL COMMENT '청구일',
|
||||
@ -427,10 +433,11 @@ CREATE TABLE `serviceinfo` (
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`code`),
|
||||
PRIMARY KEY (`uid`),
|
||||
UNIQUE KEY `UQ_code` (`code`),
|
||||
KEY `FK_user_TO_serviceinfo` (`user_uid`),
|
||||
KEY `FK_clientinfo_TO_serviceinfo` (`clientinfo_code`),
|
||||
CONSTRAINT `FK_clientinfo_TO_serviceinfo` FOREIGN KEY (`clientinfo_code`) REFERENCES `clientinfo` (`code`),
|
||||
KEY `FK_clientinfo_TO_serviceinfo` (`clientinfo_uid`),
|
||||
CONSTRAINT `FK_clientinfo_TO_serviceinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`),
|
||||
CONSTRAINT `FK_user_TO_serviceinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='서비스정보';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@ -452,15 +459,17 @@ DROP TABLE IF EXISTS `switchinfo`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `switchinfo` (
|
||||
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '스위치정보',
|
||||
`serverinfo_uid` int(11) DEFAULT NULL COMMENT '서버정보',
|
||||
`code` varchar(20) NOT NULL COMMENT 'switch코드',
|
||||
`serverinfo_code` varchar(20) DEFAULT NULL COMMENT '서버코드',
|
||||
`status` varchar(20) NOT NULL DEFAULT 'available',
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`code`),
|
||||
KEY `FK_serverinfo_TO_switchinfo` (`serverinfo_code`),
|
||||
CONSTRAINT `FK_serverinfo_TO_switchinfo` FOREIGN KEY (`serverinfo_code`) REFERENCES `serverinfo` (`code`)
|
||||
PRIMARY KEY (`uid`),
|
||||
UNIQUE KEY `UQ_code` (`code`),
|
||||
KEY `FK_serverinfo_TO_switchinfo` (`serverinfo_uid`),
|
||||
CONSTRAINT `FK_serverinfo_TO_switchinfo` FOREIGN KEY (`serverinfo_uid`) REFERENCES `serverinfo` (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='스위치정보';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
@ -548,4 +557,4 @@ UNLOCK TABLES;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-08-19 17:54:30
|
||||
-- Dump completed on 2025-08-20 11:06:56
|
||||
|
||||
@ -13,6 +13,6 @@ abstract class CustomerEntity extends CommonEntity
|
||||
//고객정보객체
|
||||
final public function getClientUID(): int
|
||||
{
|
||||
return intval($this->attributes['clientinfo_code']);
|
||||
return intval($this->attributes['clientinfo_uid']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,11 +19,11 @@ class PaymentEntity extends CustomerEntity
|
||||
}
|
||||
final public function getClientCode(): int
|
||||
{
|
||||
return intval($this->attributes['clientinfo_code']);
|
||||
return intval($this->attributes['clientinfo_uid']);
|
||||
}
|
||||
final public function getServiceCode(): int
|
||||
{
|
||||
return intval($this->attributes['serviceinfo_code']);
|
||||
return intval($this->attributes['serviceinfo_uid']);
|
||||
}
|
||||
//타 객체정의 부분
|
||||
public function getItemType(): string
|
||||
|
||||
@ -269,7 +269,7 @@ class CommonHelper
|
||||
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' tinymce' : 'tinymce';
|
||||
$form = form_textarea($field, $value ?? "", ['id' => $field, ...$extras]);
|
||||
break;
|
||||
case 'clientinfo_code':
|
||||
case 'clientinfo_uid':
|
||||
case 'user_uid':
|
||||
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
|
||||
$form = $this->form_dropdown_disabled($field, $value, $viewDatas['control']['filter_optons'][$field], $extras);
|
||||
|
||||
@ -24,7 +24,7 @@ class ClientHelper extends CustomerHelper
|
||||
number_format(intval($value)) . "원",
|
||||
'index',
|
||||
[
|
||||
"data-src" => "/admin/customer/account?clientinfo_code={$viewDatas['entity']->getPK()}&ActionTemplate=popup",
|
||||
"data-src" => "/admin/customer/account?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup",
|
||||
"data-bs-toggle" => "modal",
|
||||
"data-bs-target" => "#index_action_form",
|
||||
...$extras
|
||||
@ -37,7 +37,7 @@ class ClientHelper extends CustomerHelper
|
||||
number_format(intval($value)) . "개",
|
||||
'index',
|
||||
[
|
||||
"data-src" => "/admin/customer/coupon?clientinfo_code={$viewDatas['entity']->getPK()}&ActionTemplate=popup",
|
||||
"data-src" => "/admin/customer/coupon?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup",
|
||||
"data-bs-toggle" => "modal",
|
||||
"data-bs-target" => "#index_action_form",
|
||||
...$extras
|
||||
@ -50,7 +50,7 @@ class ClientHelper extends CustomerHelper
|
||||
number_format(intval($value)) . "원",
|
||||
'index',
|
||||
[
|
||||
"data-src" => "/admin/customer/point?clientinfo_code={$viewDatas['entity']->getPK()}&ActionTemplate=popup",
|
||||
"data-src" => "/admin/customer/point?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup",
|
||||
"data-bs-toggle" => "modal",
|
||||
"data-bs-target" => "#index_action_form",
|
||||
...$extras
|
||||
@ -89,7 +89,7 @@ class ClientHelper extends CustomerHelper
|
||||
ICONS['HISTORY'],
|
||||
$action,
|
||||
[
|
||||
"data-src" => "/admin/customer/clienthistory?clientinfo_code={$viewDatas['entity']->getPK()}",
|
||||
"data-src" => "/admin/customer/clienthistory?clientinfo_uid={$viewDatas['entity']->getPK()}",
|
||||
"data-bs-toggle" => "modal",
|
||||
"data-bs-target" => "#index_action_form",
|
||||
...$extras
|
||||
|
||||
@ -22,8 +22,8 @@ class PaymentHelper extends CustomerHelper
|
||||
//ItemType에 따라 필터옵션에서 Title을 가져옴
|
||||
$value = $viewDatas['control']['filter_optons'][$viewDatas['entity']->getItemType()][$value]->getTitle();
|
||||
break;
|
||||
case 'serviceinfo_code':
|
||||
case 'clientinfo_code':
|
||||
case 'serviceinfo_uid':
|
||||
case 'clientinfo_uid':
|
||||
case 'billing_method':
|
||||
$value = array_key_exists($value, $viewDatas['control']['filter_optons'][$field]) && $viewDatas['control']['filter_optons'][$field][$value] ? $viewDatas['control']['filter_optons'][$field][$value]->getTitle() : "";
|
||||
break;
|
||||
|
||||
@ -30,7 +30,7 @@ class ServiceHelper extends CustomerHelper
|
||||
ICONS['SETUP'],
|
||||
$field,
|
||||
[
|
||||
"data-src" => "/admin/customer/serviceitem?serviceinfo_code={$viewDatas['entity']->getPK()}&item_type={$field}",
|
||||
"data-src" => "/admin/customer/serviceitem?serviceinfo_uid={$viewDatas['entity']->getPK()}&item_type={$field}",
|
||||
"data-bs-toggle" => "modal",
|
||||
"data-bs-target" => "#index_action_form",
|
||||
...$extras
|
||||
@ -59,14 +59,14 @@ class ServiceHelper extends CustomerHelper
|
||||
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
||||
{
|
||||
switch ($field) {
|
||||
case 'clientinfo_code':
|
||||
case 'clientinfo_uid':
|
||||
case 'ownerinfo_uid':
|
||||
$temp = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||
$value = $temp . form_label(
|
||||
ICONS['HISTORY'],
|
||||
'client_history',
|
||||
[
|
||||
"data-src" => "/admin/customer/clienthistory?clientinfo_code={$value}",
|
||||
"data-src" => "/admin/customer/clienthistory?clientinfo_uid={$value}",
|
||||
"data-bs-toggle" => "modal",
|
||||
"data-bs-target" => "#index_action_form",
|
||||
"class" => "btn btn-outline btn-primary btn-circle",
|
||||
@ -127,7 +127,7 @@ class ServiceHelper extends CustomerHelper
|
||||
$label ? $label : ICONS['HISTORY'],
|
||||
$action,
|
||||
[
|
||||
"data-src" => "/admin/customer/servicehistory?serviceinfo_code={$viewDatas['entity']->getPK()}",
|
||||
"data-src" => "/admin/customer/servicehistory?serviceinfo_uid={$viewDatas['entity']->getPK()}",
|
||||
"data-bs-toggle" => "modal",
|
||||
"data-bs-target" => "#index_action_form",
|
||||
...$extras
|
||||
|
||||
14
app/Helpers/Equipment/PartHelper.php
Normal file
14
app/Helpers/Equipment/PartHelper.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Helpers\Equipment;
|
||||
|
||||
use App\Models\Equipment\PartModel;
|
||||
|
||||
class PartHelper extends EquipmentHelper
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->setTitleField(field: PartModel::TITLE);
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
return [
|
||||
'title' => "고객예치금",
|
||||
'label' => [
|
||||
'clientinfo_code' => "고객명",
|
||||
'clientinfo_uid' => "고객명",
|
||||
'title' => "제목",
|
||||
'alias' => "입/출금자명",
|
||||
'amount' => "금액",
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
return [
|
||||
'title' => "고객쿠폰",
|
||||
'label' => [
|
||||
'clientinfo_code' => "고객명",
|
||||
'clientinfo_uid' => "고객명",
|
||||
'title' => "제목",
|
||||
'amount' => "갯수",
|
||||
'status' => "추가/사용",
|
||||
|
||||
@ -3,8 +3,8 @@ return [
|
||||
'title' => "서비스결제정보",
|
||||
'label' => [
|
||||
'user_uid' => "관리자",
|
||||
'clientinfo_code' => "고객",
|
||||
'serviceinfo_code' => "서비스",
|
||||
'clientinfo_uid' => "고객",
|
||||
'serviceinfo_uid' => "서비스",
|
||||
'amount' => "청구금액",
|
||||
'billing_method' => "청구방법",
|
||||
'billing_at' => "지급기한일",
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
return [
|
||||
'title' => "고객포인트",
|
||||
'label' => [
|
||||
'clientinfo_code' => "고객명",
|
||||
'clientinfo_uid' => "고객명",
|
||||
'title' => "제목",
|
||||
'amount' => "금액",
|
||||
'status' => "입/출금",
|
||||
|
||||
@ -3,8 +3,8 @@ return [
|
||||
'title' => "서비스정보",
|
||||
'label' => [
|
||||
'user_uid' => "관리자",
|
||||
'clientinfo_code' => "고객",
|
||||
'serverinfo_code' => "서버",
|
||||
'clientinfo_uid' => "고객",
|
||||
'serverinfo_uid' => "서버",
|
||||
'type' => "서비스형식",
|
||||
'location' => "위치",
|
||||
'billing_at' => "결제일",
|
||||
|
||||
@ -3,8 +3,8 @@ return [
|
||||
'title' => "IP정보",
|
||||
'label' => [
|
||||
'lineinfo_uid' => '회선정보',
|
||||
'clientinfo_code' => '(이전)고객정보',
|
||||
'serverinfo_code' => '서버정보',
|
||||
'clientinfo_uid' => '(이전)고객정보',
|
||||
'serverinfo_uid' => '서버정보',
|
||||
'ip' => "IP",
|
||||
'price' => "소비자금액",
|
||||
'amount' => "서비스금액",
|
||||
|
||||
23
app/Language/en/Equipment/Part.php
Normal file
23
app/Language/en/Equipment/Part.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
return [
|
||||
'title' => "부품정보",
|
||||
'label' => [
|
||||
'type' => "종류",
|
||||
'title' => "모델명",
|
||||
'price' => "금액",
|
||||
'status' => "상태",
|
||||
'updated_at' => "수정일",
|
||||
'created_at' => "작성일",
|
||||
'deleted_at' => "삭제일",
|
||||
],
|
||||
"TYPE" => [
|
||||
"CPU" => "CPU",
|
||||
"RAM" => "RAM",
|
||||
"DISK" => "DISK",
|
||||
"SOFTWARE" => "SOFTWARE",
|
||||
],
|
||||
"STATUS" => [
|
||||
'available' => "사용가능",
|
||||
'forbidden' => "사용불가",
|
||||
],
|
||||
];
|
||||
@ -2,8 +2,8 @@
|
||||
return [
|
||||
'title' => "서버장비정보",
|
||||
'label' => [
|
||||
'clientinfo_code' => "고객번호",
|
||||
'serviceinfo_code' => "서비스번호",
|
||||
'clientinfo_uid' => "고객번호",
|
||||
'serviceinfo_uid' => "서비스번호",
|
||||
'code' => "장비번호",
|
||||
'type' => "장비종류",
|
||||
'title' => "장비명",
|
||||
|
||||
@ -13,7 +13,7 @@ class AccountModel extends CustomerModel
|
||||
protected $primaryKey = self::PK;
|
||||
protected $returnType = AccountEntity::class;
|
||||
protected $allowedFields = [
|
||||
"clientinfo_code",
|
||||
"clientinfo_uid",
|
||||
"status",
|
||||
"alias",
|
||||
"title",
|
||||
@ -30,7 +30,7 @@ class AccountModel extends CustomerModel
|
||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||
}
|
||||
switch ($field) {
|
||||
case "clientinfo_code":
|
||||
case "clientinfo_uid":
|
||||
case "amount":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
|
||||
@ -7,12 +7,14 @@ use App\Entities\Customer\ClientEntity;
|
||||
class ClientModel extends CustomerModel
|
||||
{
|
||||
const TABLE = "clientinfo";
|
||||
const PK = "code";
|
||||
const PK = "uid";
|
||||
const TITLE = "name";
|
||||
protected $table = self::TABLE;
|
||||
// protected $useAutoIncrement = false;
|
||||
protected $primaryKey = self::PK;
|
||||
protected $returnType = ClientEntity::class;
|
||||
protected $allowedFields = [
|
||||
"site",
|
||||
"code",
|
||||
"name",
|
||||
"email",
|
||||
@ -34,14 +36,15 @@ class ClientModel extends CustomerModel
|
||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||
}
|
||||
switch ($field) {
|
||||
case $this->getPKField():
|
||||
$rule = "required|trim|min_length[4]|max_length[20]";
|
||||
case "code":
|
||||
$rule = "required|trim|alpha_numeric|min_length[4]|max_length[20]";
|
||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||
break;
|
||||
case "name":
|
||||
$rule = "required|trim|string";
|
||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||
break;
|
||||
case "site":
|
||||
case "role":
|
||||
$rule = "required|trim|string";
|
||||
break;
|
||||
@ -59,12 +62,12 @@ class ClientModel extends CustomerModel
|
||||
}
|
||||
return $rule;
|
||||
}
|
||||
|
||||
//입력후 코드처리
|
||||
protected function create_process(array $formDatas): ClientEntity
|
||||
{
|
||||
$entity = parent::create_process($formDatas);
|
||||
// 생성 후, 추가 작업이 필요할 경우 여기에 작성
|
||||
$formDatas = ['code' => SITE_PREFIX['Client'] . $entity->getPK()];
|
||||
$formDatas = ['code' => SITE_PREFIX[$formDatas['site']] . $entity->getPK()];
|
||||
return $this->modify($entity, $formDatas);
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ class CouponModel extends CustomerModel
|
||||
protected $primaryKey = self::PK;
|
||||
protected $returnType = CouponEntity::class;
|
||||
protected $allowedFields = [
|
||||
"clientinfo_code",
|
||||
"clientinfo_uid",
|
||||
"status",
|
||||
"title",
|
||||
"amount",
|
||||
@ -29,7 +29,7 @@ class CouponModel extends CustomerModel
|
||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||
}
|
||||
switch ($field) {
|
||||
case "clientinfo_code":
|
||||
case "clientinfo_uid":
|
||||
case "amount":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
|
||||
@ -15,8 +15,8 @@ class PaymentModel extends CustomerModel
|
||||
protected $returnType = PaymentEntity::class;
|
||||
protected $allowedFields = [
|
||||
"user_uid",
|
||||
"clientinfo_code",
|
||||
"serviceinfo_code",
|
||||
"clientinfo_uid",
|
||||
"serviceinfo_uid",
|
||||
"title",
|
||||
"amount",
|
||||
"billing_method",
|
||||
@ -41,8 +41,8 @@ class PaymentModel extends CustomerModel
|
||||
break;
|
||||
case "title":
|
||||
case "billing_method":
|
||||
case "clientinfo_code":
|
||||
case "serviceinfo_code":
|
||||
case "clientinfo_uid":
|
||||
case "serviceinfo_uid":
|
||||
$rule = "required|trim|string";
|
||||
break;
|
||||
case "billing_at":
|
||||
|
||||
@ -13,7 +13,7 @@ class PointModel extends CustomerModel
|
||||
protected $primaryKey = self::PK;
|
||||
protected $returnType = PointEntity::class;
|
||||
protected $allowedFields = [
|
||||
"clientinfo_code",
|
||||
"clientinfo_uid",
|
||||
"status",
|
||||
"title",
|
||||
"amount",
|
||||
@ -29,7 +29,7 @@ class PointModel extends CustomerModel
|
||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||
}
|
||||
switch ($field) {
|
||||
case "clientinfo_code":
|
||||
case "clientinfo_uid":
|
||||
case "amount":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
|
||||
@ -3,19 +3,21 @@
|
||||
namespace App\Models\Customer;
|
||||
|
||||
use App\Entities\Customer\ServiceEntity;
|
||||
use tidy;
|
||||
|
||||
class ServiceModel extends CustomerModel
|
||||
{
|
||||
const TABLE = "serviceinfo";
|
||||
const PK = "uid";
|
||||
const PK = "code";
|
||||
const TITLE = "code";
|
||||
protected $table = self::TABLE;
|
||||
// protected $useAutoIncrement = false;
|
||||
protected $primaryKey = self::PK;
|
||||
protected $returnType = ServiceEntity::class;
|
||||
protected $allowedFields = [
|
||||
"user_uid",
|
||||
"clientinfo_code",
|
||||
"serverinfo_code",
|
||||
"clientinfo_uid",
|
||||
"code",
|
||||
"type",
|
||||
"location",
|
||||
"billing_at",
|
||||
@ -23,7 +25,6 @@ class ServiceModel extends CustomerModel
|
||||
"start_at",
|
||||
"end_at",
|
||||
"status",
|
||||
"updated_at"
|
||||
];
|
||||
public function __construct()
|
||||
{
|
||||
@ -35,12 +36,15 @@ class ServiceModel extends CustomerModel
|
||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||
}
|
||||
switch ($field) {
|
||||
case $this->getPKField():
|
||||
$rule = "required|trim|alpha_numeric|min_length[4]|max_length[20]";
|
||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||
break;
|
||||
case "user_uid":
|
||||
case "serverinfo_code":
|
||||
case "amount":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
case "clientinfo_code":
|
||||
case "clientinfo_uid":
|
||||
case "type":
|
||||
case "location":
|
||||
case "status":
|
||||
@ -59,12 +63,10 @@ class ServiceModel extends CustomerModel
|
||||
}
|
||||
return $rule;
|
||||
}
|
||||
//Create용
|
||||
//입력전 코드처리
|
||||
protected function create_process(array $formDatas): ServiceEntity
|
||||
{
|
||||
$entity = parent::create_process($formDatas);
|
||||
// 생성 후, 추가 작업이 필요할 경우 여기에 작성
|
||||
$formDatas = ['code' => SITE_PREFIX['Service'] . time()];
|
||||
return $this->modify($entity, $formDatas);
|
||||
$formDatas['code'] = "s" . time();
|
||||
return parent::create_process($formDatas);
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,9 +18,7 @@ class CSModel extends EquipmentModel
|
||||
"accountid",
|
||||
"domain",
|
||||
"price",
|
||||
"amount",
|
||||
"status",
|
||||
"updated_at"
|
||||
];
|
||||
public function __construct()
|
||||
{
|
||||
@ -32,10 +30,6 @@ class CSModel extends EquipmentModel
|
||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||
}
|
||||
switch ($field) {
|
||||
case "model":
|
||||
$rule = "required|trim|string";
|
||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||
break;
|
||||
case "type":
|
||||
$rule = "required|trim|string";
|
||||
break;
|
||||
@ -44,9 +38,11 @@ class CSModel extends EquipmentModel
|
||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||
break;
|
||||
case "price":
|
||||
case "amount":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
case "domain":
|
||||
$rule = "if_exist|trim|string";
|
||||
break;
|
||||
default:
|
||||
$rule = parent::getFormFieldRule($action, $field);
|
||||
break;
|
||||
|
||||
@ -14,8 +14,8 @@ class IpModel extends EquipmentModel
|
||||
protected $returnType = IpEntity::class;
|
||||
protected $allowedFields = [
|
||||
"lineinfo_uid",
|
||||
"clientinfo_code",
|
||||
"serverinfo_code",
|
||||
"clientinfo_uid",
|
||||
"serverinfo_uid",
|
||||
"ip",
|
||||
"price",
|
||||
"amount",
|
||||
@ -36,8 +36,8 @@ class IpModel extends EquipmentModel
|
||||
case "lineinfo_uid":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
case "clientinfo_code":
|
||||
case "serverinfo_code":
|
||||
case "clientinfo_uid":
|
||||
case "serverinfo_uid":
|
||||
case "history":
|
||||
$rule = "if_exist|trim|string";
|
||||
break;
|
||||
|
||||
@ -11,7 +11,9 @@ class PartModel extends EquipmentModel
|
||||
const TITLE = "title";
|
||||
protected $table = self::TABLE;
|
||||
protected $primaryKey = self::PK;
|
||||
protected $returnType = PartEntity::class;
|
||||
protected $allowedFields = [
|
||||
"type",
|
||||
"title",
|
||||
"price",
|
||||
"status",
|
||||
@ -19,7 +21,6 @@ class PartModel extends EquipmentModel
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->returnType = PartEntity::class;
|
||||
}
|
||||
final public function getFormFieldRule(string $action, string $field): string
|
||||
{
|
||||
@ -27,10 +28,14 @@ class PartModel extends EquipmentModel
|
||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||
}
|
||||
switch ($field) {
|
||||
case "model":
|
||||
case "title":
|
||||
$rule = "required|trim|string";
|
||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||
break;
|
||||
case "type":
|
||||
case "status":
|
||||
$rule = "required|trim|string";
|
||||
break;
|
||||
case "price":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
|
||||
@ -7,15 +7,22 @@ use App\Entities\Equipment\ServerEntity;
|
||||
class ServerModel extends EquipmentModel
|
||||
{
|
||||
const TABLE = "serverinfo";
|
||||
const PK = "code";
|
||||
const PK = "uid";
|
||||
const TITLE = "title";
|
||||
protected $table = self::TABLE;
|
||||
// protected $useAutoIncrement = false;
|
||||
protected $primaryKey = self::PK;
|
||||
protected $returnType = ServerEntity::class;
|
||||
protected $allowedFields = [
|
||||
"clientinfo_uid",
|
||||
"serviceinfo_uid",
|
||||
"code",
|
||||
"type",
|
||||
"title",
|
||||
"price",
|
||||
"manufactur_at",
|
||||
"format_at",
|
||||
"status",
|
||||
"updated_at"
|
||||
];
|
||||
public function __construct()
|
||||
{
|
||||
@ -27,10 +34,14 @@ class ServerModel extends EquipmentModel
|
||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||
}
|
||||
switch ($field) {
|
||||
case $this->getPKField():
|
||||
$rule = "required|trim|min_length[4]|max_length[20]";
|
||||
case "code":
|
||||
$rule = "required|trim|alpha_numeric|min_length[4]|max_length[20]";
|
||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||
break;
|
||||
case "type":
|
||||
case "status":
|
||||
$rule = "required|trim|string";
|
||||
break;
|
||||
case "title":
|
||||
$rule = "required|trim|string";
|
||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||
@ -38,6 +49,12 @@ class ServerModel extends EquipmentModel
|
||||
case "price":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
case "manufactur_at":
|
||||
$rule = "required|valid_date";
|
||||
break;
|
||||
case "format_at":
|
||||
$rule = "if_exist|valid_date";
|
||||
break;
|
||||
default:
|
||||
$rule = parent::getFormFieldRule($action, $field);
|
||||
break;
|
||||
|
||||
@ -7,17 +7,16 @@ use App\Entities\Equipment\SwitchEntity;
|
||||
class SwitchModel extends EquipmentModel
|
||||
{
|
||||
const TABLE = "switchinfo";
|
||||
const PK = "code";
|
||||
const PK = "uid";
|
||||
const TITLE = "code";
|
||||
protected $table = self::TABLE;
|
||||
protected $primaryKey = self::PK;
|
||||
protected $useAutoIncrement = false;
|
||||
// protected $useAutoIncrement = false;
|
||||
protected $returnType = SwitchEntity::class;
|
||||
protected $allowedFields = [
|
||||
"code",
|
||||
"serverinfo__code",
|
||||
"serverinfo_uid",
|
||||
"status",
|
||||
"updated_at"
|
||||
];
|
||||
public function __construct()
|
||||
{
|
||||
@ -29,8 +28,8 @@ class SwitchModel extends EquipmentModel
|
||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||
}
|
||||
switch ($field) {
|
||||
case $this->getPKField():
|
||||
$rule = "required|trim|min_length[4]|max_length[20]";
|
||||
case "code":
|
||||
$rule = "required|trim|alpha_numeric|min_length[4]|max_length[20]";
|
||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||
break;
|
||||
case "status":
|
||||
|
||||
@ -77,7 +77,7 @@ abstract class CommonService
|
||||
throw new \Exception($message);
|
||||
}
|
||||
}
|
||||
protected function findAllDatas_process(array $columns = ['*']): mixed
|
||||
protected function findAllDatas_process(array $columns = ['*']): array
|
||||
{
|
||||
$entities = $this->getModel()->select(implode(',', $columns))->findAll();
|
||||
// dd($entities);
|
||||
|
||||
@ -16,7 +16,7 @@ class AccountService extends CustomerService
|
||||
public function getFormFields(): array
|
||||
{
|
||||
return [
|
||||
"clientinfo_code",
|
||||
"clientinfo_uid",
|
||||
"status",
|
||||
"alias",
|
||||
"title",
|
||||
@ -25,7 +25,7 @@ class AccountService extends CustomerService
|
||||
}
|
||||
public function getFilterFields(): array
|
||||
{
|
||||
return ["clientinfo_code", 'status'];
|
||||
return ["clientinfo_uid", 'status'];
|
||||
}
|
||||
public function getBatchJobFields(): array
|
||||
{
|
||||
@ -37,9 +37,9 @@ class AccountService extends CustomerService
|
||||
private function setBalance(array $formDatas): void
|
||||
{
|
||||
//account_balance 체크
|
||||
$entity = $this->getClientService()->getEntity($formDatas['clientinfo_code']);
|
||||
$entity = $this->getClientService()->getEntity($formDatas['clientinfo_uid']);
|
||||
if (!$entity) {
|
||||
throw new \Exception("{$formDatas['clientinfo_code']}에 대한 고객정보를 찾을수 없습니다.");
|
||||
throw new \Exception("{$formDatas['clientinfo_uid']}에 대한 고객정보를 찾을수 없습니다.");
|
||||
}
|
||||
$amount = intval($formDatas['amount']);
|
||||
// dd($formDatas);
|
||||
|
||||
@ -16,7 +16,7 @@ class CouponService extends CustomerService
|
||||
public function getFormFields(): array
|
||||
{
|
||||
return [
|
||||
"clientinfo_code",
|
||||
"clientinfo_uid",
|
||||
"status",
|
||||
"title",
|
||||
"amount",
|
||||
@ -24,7 +24,7 @@ class CouponService extends CustomerService
|
||||
}
|
||||
public function getFilterFields(): array
|
||||
{
|
||||
return ["clientinfo_code", 'status'];
|
||||
return ["clientinfo_uid", 'status'];
|
||||
}
|
||||
public function getBatchJobFields(): array
|
||||
{
|
||||
@ -36,9 +36,9 @@ class CouponService extends CustomerService
|
||||
private function setBalance(array $formDatas): void
|
||||
{
|
||||
//coupon_balance 체크
|
||||
$entity = $this->getClientService()->getEntity($formDatas['clientinfo_code']);
|
||||
$entity = $this->getClientService()->getEntity($formDatas['clientinfo_uid']);
|
||||
if (!$entity) {
|
||||
throw new \Exception("{$formDatas['clientinfo_code']}에 대한 고객정보를 찾을수 없습니다.");
|
||||
throw new \Exception("{$formDatas['clientinfo_uid']}에 대한 고객정보를 찾을수 없습니다.");
|
||||
}
|
||||
$amount = intval($formDatas['amount']);
|
||||
if ($formDatas['status'] === CouponEntity::DEFAULT_STATUS) { //입금, 쿠폰추가
|
||||
|
||||
@ -58,13 +58,13 @@ abstract class CustomerService extends CommonService
|
||||
case 'user_uid':
|
||||
$options = $this->getUserService()->getEntities();
|
||||
break;
|
||||
case 'clientinfo_code':
|
||||
case 'clientinfo_uid':
|
||||
$options = $this->getClientService()->getEntities();
|
||||
break;
|
||||
case 'serviceinfo_code':
|
||||
case 'serviceinfo_uid':
|
||||
$options = $this->getServiceService()->getEntities();
|
||||
break;
|
||||
case 'serverinfo_code':
|
||||
case 'serverinfo_uid':
|
||||
$options = $this->getServerService()->getEntities();
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -25,8 +25,8 @@ class PaymentService extends CustomerService
|
||||
public function getFormFields(): array
|
||||
{
|
||||
return [
|
||||
"clientinfo_code",
|
||||
"serviceinfo_code",
|
||||
"clientinfo_uid",
|
||||
"serviceinfo_uid",
|
||||
"title",
|
||||
"amount",
|
||||
"billing_method",
|
||||
@ -38,15 +38,15 @@ class PaymentService extends CustomerService
|
||||
}
|
||||
public function getFilterFields(): array
|
||||
{
|
||||
return ['clientinfo_code', 'billing_method', 'pay_method', 'status', 'user_uid'];
|
||||
return ['clientinfo_uid', 'billing_method', 'pay_method', 'status', 'user_uid'];
|
||||
}
|
||||
public function getBatchJobFields(): array
|
||||
{
|
||||
return ['clientinfo_code', 'billing_method', 'pay_method', 'status'];
|
||||
return ['clientinfo_uid', 'billing_method', 'pay_method', 'status'];
|
||||
}
|
||||
public function getIndexFields(): array
|
||||
{
|
||||
return ['clientinfo_code', 'billing_method', 'amount', 'billing_at', 'pay_method', 'status', 'countdown', 'user_uid'];
|
||||
return ['clientinfo_uid', 'billing_method', 'amount', 'billing_at', 'pay_method', 'status', 'countdown', 'user_uid'];
|
||||
}
|
||||
public function getBatchJobButtons(): array
|
||||
{
|
||||
@ -62,10 +62,10 @@ class PaymentService extends CustomerService
|
||||
case 'user_uid':
|
||||
$options = $this->getUserService()->getEntities();
|
||||
break;
|
||||
case 'clientinfo_code':
|
||||
case 'clientinfo_uid':
|
||||
$options = $this->getClientService()->getEntities();
|
||||
break;
|
||||
case 'serviceinfo_code':
|
||||
case 'serviceinfo_uid':
|
||||
$options = $this->getServiceService()->getEntities();
|
||||
break;
|
||||
default:
|
||||
@ -77,13 +77,13 @@ class PaymentService extends CustomerService
|
||||
//미납서비스 정보
|
||||
final public function getUnPaidCount(): array
|
||||
{
|
||||
$sql = sprintf("SELECT serviceinfo_code,COUNT(*) as CNT
|
||||
$sql = sprintf("SELECT serviceinfo_uid,COUNT(*) as CNT
|
||||
FROM payment
|
||||
WHERE billing_at < NOW() AND amount > 0 AND status = '%s'
|
||||
GROUP BY serviceinfo_code", PaymentEntity::DEFAULT_STATUS);
|
||||
GROUP BY serviceinfo_uid", PaymentEntity::DEFAULT_STATUS);
|
||||
$unpaids = [];
|
||||
foreach ($this->getModel()->query($sql)->getResult() as $row) {
|
||||
$unpaids[$row->serverinfo_code] = $row->CNT;
|
||||
$unpaids[$row->serverinfo_uid] = $row->CNT;
|
||||
}
|
||||
return $unpaids;
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ class PointService extends CustomerService
|
||||
public function getFormFields(): array
|
||||
{
|
||||
return [
|
||||
"clientinfo_code",
|
||||
"clientinfo_uid",
|
||||
"status",
|
||||
"title",
|
||||
"amount"
|
||||
@ -24,7 +24,7 @@ class PointService extends CustomerService
|
||||
}
|
||||
public function getFilterFields(): array
|
||||
{
|
||||
return ["clientinfo_code", 'status'];
|
||||
return ["clientinfo_uid", 'status'];
|
||||
}
|
||||
public function getBatchJobFields(): array
|
||||
{
|
||||
@ -35,9 +35,9 @@ class PointService extends CustomerService
|
||||
private function setBalance(array $formDatas): void
|
||||
{
|
||||
//point_balance 체크
|
||||
$entity = $this->getClientService()->getEntity($formDatas['clientinfo_code']);
|
||||
$entity = $this->getClientService()->getEntity($formDatas['clientinfo_uid']);
|
||||
if (!$entity) {
|
||||
throw new \Exception("{$formDatas['clientinfo_code']}에 대한 고객정보를 찾을수 없습니다.");
|
||||
throw new \Exception("{$formDatas['clientinfo_uid']}에 대한 고객정보를 찾을수 없습니다.");
|
||||
}
|
||||
$amount = intval($formDatas['amount']);
|
||||
if ($formDatas['status'] === PointEntity::DEFAULT_STATUS) { //입금, 쿠폰추가
|
||||
|
||||
@ -17,8 +17,7 @@ class ServiceService extends CustomerService
|
||||
public function getFormFields(): array
|
||||
{
|
||||
return [
|
||||
"clientinfo_code",
|
||||
"serverinfo_code",
|
||||
"clientinfo_uid",
|
||||
"type",
|
||||
"location",
|
||||
"billing_at",
|
||||
@ -30,15 +29,15 @@ class ServiceService extends CustomerService
|
||||
}
|
||||
public function getFilterFields(): array
|
||||
{
|
||||
return ['clientinfo_code', 'serverinfo_code', 'type', 'location', 'status'];
|
||||
return ['clientinfo_uid', 'serverinfo_uid', 'type', 'location', 'status'];
|
||||
}
|
||||
public function getBatchJobFields(): array
|
||||
{
|
||||
return ['clientinfo_code', 'status'];
|
||||
return ['clientinfo_uid', 'status'];
|
||||
}
|
||||
public function getIndexFields(): array
|
||||
{
|
||||
return ['clientinfo_code', 'type', 'location', 'serverinfo_code', 'billing_at', 'amount', 'start_at', 'end_at', 'updated_at', 'status', 'user_uid'];
|
||||
return ['clientinfo_uid', 'type', 'location', 'serverinfo_uid', 'billing_at', 'amount', 'start_at', 'end_at', 'updated_at', 'status', 'user_uid'];
|
||||
}
|
||||
//Entity의 관련객체정의용
|
||||
public function setSearchIp(string $ip): void
|
||||
@ -54,7 +53,7 @@ class ServiceService extends CustomerService
|
||||
// $ip = $this->getSearchIp();
|
||||
// if ($ip) {
|
||||
// $sql = "SELECT serviceinfo.* FROM serviceinfo
|
||||
// LEFT JOIN serviceinfo_items ON serviceinfo.uid = serviceinfo_items.serviceinfo_code
|
||||
// LEFT JOIN serviceinfo_items ON serviceinfo.uid = serviceinfo_items.serviceinfo_uid
|
||||
// WHERE serviceinfo_items.item_type = ?
|
||||
// AND serviceinfo_items.item_uid IN (SELECT uid FROM ipinfo WHERE ip = ?)";
|
||||
// return $this->getModel()->query($sql, ['IP', $ip])->getResult(ServiceEntity::class);
|
||||
|
||||
@ -20,7 +20,6 @@ class CSService extends EquipmentService
|
||||
"accountid",
|
||||
"domain",
|
||||
"price",
|
||||
"amount",
|
||||
"status",
|
||||
];
|
||||
}
|
||||
@ -34,7 +33,7 @@ class CSService extends EquipmentService
|
||||
}
|
||||
public function getIndexFields(): array
|
||||
{
|
||||
return ['type', 'ip', 'accountid', 'domain', 'price', 'amount', 'status'];
|
||||
return ['type', 'ip', 'accountid', 'domain', 'price', 'status'];
|
||||
}
|
||||
//List 검색용
|
||||
//OrderBy 처리
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Equipment;
|
||||
|
||||
use App\Entities\Equipment\Part\DomainEntity;
|
||||
use App\Models\Equipment\Part\DomainModel;
|
||||
|
||||
class DomainService extends EquipmentService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(new DomainModel());
|
||||
$this->addClassName('Domain');
|
||||
}
|
||||
public function getFormFields(): array
|
||||
{
|
||||
return [
|
||||
"domain",
|
||||
"status",
|
||||
];
|
||||
}
|
||||
public function getFilterFields(): array
|
||||
{
|
||||
return ['status',];
|
||||
}
|
||||
public function getBatchJobFields(): array
|
||||
{
|
||||
return ['status'];
|
||||
}
|
||||
|
||||
public function getIndexFields(): array
|
||||
{
|
||||
return ['domain', 'status'];
|
||||
}
|
||||
//List 검색용
|
||||
//OrderBy 처리
|
||||
public function setOrderBy(mixed $field = null, mixed $value = null): void
|
||||
{
|
||||
$this->getModel()->orderBy('domain', 'ASC');
|
||||
parent::setOrderBy($field, $value);
|
||||
}
|
||||
}
|
||||
@ -59,13 +59,13 @@ abstract class EquipmentService extends CommonService
|
||||
case 'user_uid':
|
||||
$options = $this->getUserService()->getEntities();
|
||||
break;
|
||||
case 'clientinfo_code':
|
||||
case 'clientinfo_uid':
|
||||
$options = $this->getClientService()->getEntities();
|
||||
break;
|
||||
case 'serviceinfo_code':
|
||||
case 'serviceinfo_uid':
|
||||
$options = $this->getServiceService()->getEntities();
|
||||
break;
|
||||
case 'serverinfo_code':
|
||||
case 'serverinfo_uid':
|
||||
$options = $this->getServerService()->getEntities();
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -20,8 +20,8 @@ class IpService extends EquipmentService
|
||||
{
|
||||
return [
|
||||
"lineinfo_uid",
|
||||
"clientinfo_code",
|
||||
"serverinfo_code",
|
||||
"clientinfo_uid",
|
||||
"serverinfo_uid",
|
||||
"ip",
|
||||
"price",
|
||||
"amount",
|
||||
@ -39,7 +39,7 @@ class IpService extends EquipmentService
|
||||
}
|
||||
public function getIndexFields(): array
|
||||
{
|
||||
return ['lineinfo_uid', 'clientinfo_code', 'serverinfo_code', 'ip', 'price', 'amount', 'status'];
|
||||
return ['lineinfo_uid', 'clientinfo_uid', 'serverinfo_uid', 'ip', 'price', 'amount', 'status'];
|
||||
}
|
||||
final public function getLineService(): LineService
|
||||
{
|
||||
@ -56,10 +56,10 @@ class IpService extends EquipmentService
|
||||
case 'lineinfo_uid':
|
||||
$options = $this->getLineService()->getEntities();
|
||||
break;
|
||||
case 'clientinfo_code':
|
||||
case 'clientinfo_uid':
|
||||
$options = $this->getClientService()->getEntities();
|
||||
break;
|
||||
case 'serverinfo_code':
|
||||
case 'serverinfo_uid':
|
||||
$options = $this->getServerService()->getEntities();
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -3,26 +3,42 @@
|
||||
namespace App\Services\Equipment;
|
||||
|
||||
use App\Models\Equipment\PartModel;
|
||||
use App\Services\Equipment\EquipmentService;
|
||||
|
||||
abstract class PartService extends EquipmentService
|
||||
class PartService extends EquipmentService
|
||||
{
|
||||
protected function __construct()
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(new PartModel());
|
||||
$this->addClassName('Part');
|
||||
}
|
||||
//FieldForm관련용
|
||||
public function getFormFieldOption(string $field, array $options = []): array
|
||||
public function getFormFields(): array
|
||||
{
|
||||
switch ($field) {
|
||||
case 'clientinfo_code':
|
||||
$options = $this->getClientService()->getEntities();
|
||||
break;
|
||||
default:
|
||||
$options = parent::getFormFieldOption($field, $options);
|
||||
break;
|
||||
}
|
||||
return $options;
|
||||
return [
|
||||
"type",
|
||||
"title",
|
||||
"price",
|
||||
"status",
|
||||
];
|
||||
}
|
||||
public function getFilterFields(): array
|
||||
{
|
||||
return ["type", 'status',];
|
||||
}
|
||||
public function getBatchJobFields(): array
|
||||
{
|
||||
return ['status'];
|
||||
}
|
||||
public function getIndexFields(): array
|
||||
{
|
||||
return ['type', 'title', 'price', 'status', 'created_at'];
|
||||
}
|
||||
//기본 기능부분
|
||||
//FieldForm관련용
|
||||
//List 검색용
|
||||
//OrderBy 처리
|
||||
public function setOrderBy(mixed $field = null, mixed $value = null): void
|
||||
{
|
||||
$this->getModel()->orderBy('type ASC, title ASC');
|
||||
parent::setOrderBy($field, $value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,8 +16,8 @@ class ServerService extends EquipmentService
|
||||
public function getFormFields(): array
|
||||
{
|
||||
return [
|
||||
"clientinfo_code",
|
||||
"serviceinfo_code",
|
||||
"clientinfo_uid",
|
||||
"serviceinfo_uid",
|
||||
"code",
|
||||
"type",
|
||||
"title",
|
||||
@ -38,7 +38,7 @@ class ServerService extends EquipmentService
|
||||
}
|
||||
public function getIndexFields(): array
|
||||
{
|
||||
return ['clientinfo_code', 'serviceinfo_code', "type", 'title', 'price', 'total_price', 'manufactur_at', "format_at", 'status'];
|
||||
return ['clientinfo_uid', 'serviceinfo_uid', "type", 'title', 'price', 'total_price', 'manufactur_at', "format_at", 'status'];
|
||||
}
|
||||
//기본 기능부분
|
||||
//FieldForm관련용
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<?php $viewDatas['entity'] = $entity ?>
|
||||
<tr>
|
||||
<td><?= $viewDatas['helper']->getListButton('new_service_view', '', $viewDatas, ['label' => $entity->getTitle()]) ?></td>
|
||||
<td><?= $viewDatas['helper']->getFieldView('clientinfo_code', $entity->getClientCode(), $viewDatas) ?></td>
|
||||
<td><?= $viewDatas['helper']->getFieldView('clientinfo_uid', $entity->getClientCode(), $viewDatas) ?></td>
|
||||
<td><?= $viewDatas['helper']->getFieldView('type', $entity->getType(), $viewDatas) ?></td>
|
||||
<td><?= $viewDatas['helper']->getFieldView('switchinfo_uid', $entity->getSwitchCode(), $viewDatas) ?></td>
|
||||
<td><?= $viewDatas['helper']->getFieldView('IP', null, $viewDatas) ?></td>
|
||||
|
||||
@ -2963,7 +2963,7 @@
|
||||
"35XbdvgOzpNdasPnMcbkx": {
|
||||
"id": "35XbdvgOzpNdasPnMcbkx",
|
||||
"tableId": "jO40Ej5EXImXnadoJo9bn",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "고객정보",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -3003,7 +3003,7 @@
|
||||
"X1GxGekOLLuoEkqGQDF86": {
|
||||
"id": "X1GxGekOLLuoEkqGQDF86",
|
||||
"tableId": "5AUwJum9FKPCoYRMBhLnF",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -3163,7 +3163,7 @@
|
||||
"PyXYmokQzpzzT08WTmtsN": {
|
||||
"id": "PyXYmokQzpzzT08WTmtsN",
|
||||
"tableId": "5AUwJum9FKPCoYRMBhLnF",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "고객정보",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -3863,7 +3863,7 @@
|
||||
"F6TXYV3uwRzb-aZYCmf5x": {
|
||||
"id": "F6TXYV3uwRzb-aZYCmf5x",
|
||||
"tableId": "B4qGh3KZsXHQ3_4EOgwJZ",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "소유자",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -3903,7 +3903,7 @@
|
||||
"ha72QbBWfvyRymsyFBov8": {
|
||||
"id": "ha72QbBWfvyRymsyFBov8",
|
||||
"tableId": "RMhrLs7bOaopKmKt9YKHQ",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "소유자",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -4023,7 +4023,7 @@
|
||||
"Ue1gt0C4DyjOQswV8LxkE": {
|
||||
"id": "Ue1gt0C4DyjOQswV8LxkE",
|
||||
"tableId": "doERb3lIVeBW_D0NtNYX8",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "소유자",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -4063,7 +4063,7 @@
|
||||
"5KRw8TtT2nLqpYfKFOBwe": {
|
||||
"id": "5KRw8TtT2nLqpYfKFOBwe",
|
||||
"tableId": "doERb3lIVeBW_D0NtNYX8",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "소유자정보",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -4103,7 +4103,7 @@
|
||||
"VxbbWBYPZdH63koVtdRuv": {
|
||||
"id": "VxbbWBYPZdH63koVtdRuv",
|
||||
"tableId": "RMhrLs7bOaopKmKt9YKHQ",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -4123,7 +4123,7 @@
|
||||
"kyD7tU9kevxCDow7j2uHI": {
|
||||
"id": "kyD7tU9kevxCDow7j2uHI",
|
||||
"tableId": "B4qGh3KZsXHQ3_4EOgwJZ",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -4143,7 +4143,7 @@
|
||||
"SaTapKkBzVUluKTG_fsBy": {
|
||||
"id": "SaTapKkBzVUluKTG_fsBy",
|
||||
"tableId": "ZLEpY5EjuZV21718zf-Y1",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -4163,7 +4163,7 @@
|
||||
"B5P-XTPII39W_C1xsZEM-": {
|
||||
"id": "B5P-XTPII39W_C1xsZEM-",
|
||||
"tableId": "doERb3lIVeBW_D0NtNYX8",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "고객정보",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -4443,7 +4443,7 @@
|
||||
"dluCt7VimWWwGu4Is8V0v": {
|
||||
"id": "dluCt7VimWWwGu4Is8V0v",
|
||||
"tableId": "B4qGh3KZsXHQ3_4EOgwJZ",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "소유자정보",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -4923,7 +4923,7 @@
|
||||
"qzikkq9Ixd8qxTt9ZsXU_": {
|
||||
"id": "qzikkq9Ixd8qxTt9ZsXU_",
|
||||
"tableId": "GRBrbb1hqwKSRMfod3I7U",
|
||||
"name": "serverinfo_code",
|
||||
"name": "serverinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -5403,7 +5403,7 @@
|
||||
"skdAqnMsTEE6ZKbCD14VX": {
|
||||
"id": "skdAqnMsTEE6ZKbCD14VX",
|
||||
"tableId": "GRBrbb1hqwKSRMfod3I7U",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -5463,7 +5463,7 @@
|
||||
"rK1V9ccYa0gxVE2W98dGH": {
|
||||
"id": "rK1V9ccYa0gxVE2W98dGH",
|
||||
"tableId": "GRBrbb1hqwKSRMfod3I7U",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -5483,7 +5483,7 @@
|
||||
"Z2KizkUFrIaV_R_Quv4Ho": {
|
||||
"id": "Z2KizkUFrIaV_R_Quv4Ho",
|
||||
"tableId": "doERb3lIVeBW_D0NtNYX8",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "소유자정보",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -5983,7 +5983,7 @@
|
||||
"NzxkmndrTbH7xb6fbnGV7": {
|
||||
"id": "NzxkmndrTbH7xb6fbnGV7",
|
||||
"tableId": "B8haiEbPc1lRBWTv1g25G",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "고객정보",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -6283,7 +6283,7 @@
|
||||
"TA8YG5vV7QmJxAXVpP8Tc": {
|
||||
"id": "TA8YG5vV7QmJxAXVpP8Tc",
|
||||
"tableId": "B4qGh3KZsXHQ3_4EOgwJZ",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "소유자정보",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -6443,7 +6443,7 @@
|
||||
"U3pGwK2LVZA4wQ1xa6EcF": {
|
||||
"id": "U3pGwK2LVZA4wQ1xa6EcF",
|
||||
"tableId": "GRBrbb1hqwKSRMfod3I7U",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -7863,7 +7863,7 @@
|
||||
"xM99dcx7-5WMPvULGsgWq": {
|
||||
"id": "xM99dcx7-5WMPvULGsgWq",
|
||||
"tableId": "rlCmi1ybOTx8gPwOXyjTX",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "고객정보",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -8103,7 +8103,7 @@
|
||||
"jqmxU5JhvpNsSCdKSoyT7": {
|
||||
"id": "jqmxU5JhvpNsSCdKSoyT7",
|
||||
"tableId": "H5lE3ZX7xEbV8d0OHBR95",
|
||||
"name": "serverinfo_code",
|
||||
"name": "serverinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -8143,7 +8143,7 @@
|
||||
"r0esmH8vUxxZfUM5g2LMo": {
|
||||
"id": "r0esmH8vUxxZfUM5g2LMo",
|
||||
"tableId": "VdcGlLO4HgExVJUAVEriv",
|
||||
"name": "serverinfo_code",
|
||||
"name": "serverinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -8183,7 +8183,7 @@
|
||||
"gutGFwQWK4wXhe8FtDw2o": {
|
||||
"id": "gutGFwQWK4wXhe8FtDw2o",
|
||||
"tableId": "BFhEqfFZ0L56a6Tey1OsK",
|
||||
"name": "serverinfo_code",
|
||||
"name": "serverinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -8563,7 +8563,7 @@
|
||||
"Mc9DanKrdzYxiptkoeq9J": {
|
||||
"id": "Mc9DanKrdzYxiptkoeq9J",
|
||||
"tableId": "1IgC97w7iAToPDVjmA6cP",
|
||||
"name": "serverinfo_code",
|
||||
"name": "serverinfo_uid",
|
||||
"comment": "",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -8583,7 +8583,7 @@
|
||||
"0ukDN4F_rhKa5sHuLY5FX": {
|
||||
"id": "0ukDN4F_rhKa5sHuLY5FX",
|
||||
"tableId": "RTq5rHQupiXXJPXqpN8K5",
|
||||
"name": "serverinfo_code",
|
||||
"name": "serverinfo_uid",
|
||||
"comment": "서버코드",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -8603,7 +8603,7 @@
|
||||
"g18PdAF1Il5_QWgnio9Lw": {
|
||||
"id": "g18PdAF1Il5_QWgnio9Lw",
|
||||
"tableId": "GRBrbb1hqwKSRMfod3I7U",
|
||||
"name": "serverinfo_code",
|
||||
"name": "serverinfo_uid",
|
||||
"comment": "서버코드",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -8623,7 +8623,7 @@
|
||||
"7j-v8422Rzf3ZoLGCDJGo": {
|
||||
"id": "7j-v8422Rzf3ZoLGCDJGo",
|
||||
"tableId": "ZLEpY5EjuZV21718zf-Y1",
|
||||
"name": "serverinfo_code",
|
||||
"name": "serverinfo_uid",
|
||||
"comment": "서버코드",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -8643,7 +8643,7 @@
|
||||
"UqCsY6KiCJOOFtjCHoMVL": {
|
||||
"id": "UqCsY6KiCJOOFtjCHoMVL",
|
||||
"tableId": "IsMoJXzvtuoOFFt93qS0w",
|
||||
"name": "serverinfo_code",
|
||||
"name": "serverinfo_uid",
|
||||
"comment": "서버코드",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
@ -9023,7 +9023,7 @@
|
||||
"imjqFzOrKxNF9-aH171pe": {
|
||||
"id": "imjqFzOrKxNF9-aH171pe",
|
||||
"tableId": "B4qGh3KZsXHQ3_4EOgwJZ",
|
||||
"name": "clientinfo_code",
|
||||
"name": "clientinfo_uid",
|
||||
"comment": "고객정보",
|
||||
"dataType": "INT",
|
||||
"default": "",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user