dbmsv2 init...1

This commit is contained in:
choi.jh 2025-09-09 14:51:43 +09:00
parent 1345b0e694
commit e8d7f6f08b
30 changed files with 194 additions and 142 deletions

View File

@ -370,7 +370,6 @@ define("STATUS", [
'OCCUPIED' => "occupied",
'SUCCESS' => "success",
'FAILED' => "fail",
'NORMAL' => "normal",
'PAUSE' => "pause",
'TERMINATED' => "terminated",
'WIDTHDRAWAL' => "widthdrawal",

View File

@ -4,8 +4,8 @@
"settings": {
"width": 3000,
"height": 3000,
"scrollTop": -1366.5228,
"scrollLeft": -185.0714,
"scrollTop": -621.5228,
"scrollLeft": -933.8609,
"zoomLevel": 0.73,
"show": 511,
"database": 4,
@ -752,6 +752,7 @@
"E30sHnqJytLlBmfL7ueOG",
"wi1XbZM3emknh42sOMkYq",
"sVypeCGZk-JXvsbwc93Rw",
"zWTlsCCVulhzBhncagMO_",
"QEXGVSZ3sjvmtUCdgXl6_",
"4Koam7FHw2_rCXSUBEQJB",
"d7HNONWncNoqDRCl4-Y0N",
@ -773,6 +774,7 @@
"0DqzeiTdKUa6hunIDyuc4",
"sVypeCGZk-JXvsbwc93Rw",
"_KISusuMe8-oGta7xOaz0",
"zWTlsCCVulhzBhncagMO_",
"QEXGVSZ3sjvmtUCdgXl6_",
"4Koam7FHw2_rCXSUBEQJB",
"d7HNONWncNoqDRCl4-Y0N",
@ -787,7 +789,7 @@
"color": ""
},
"meta": {
"updateAt": 1756961382553,
"updateAt": 1757395578455,
"createAt": 1750898626895
}
},
@ -1089,7 +1091,7 @@
"name": "status",
"comment": "",
"dataType": "VARCHAR(20)",
"default": "'normal'",
"default": "'available'",
"options": 8,
"ui": {
"keys": 0,
@ -1099,7 +1101,7 @@
"widthDefault": 60
},
"meta": {
"updateAt": 1755592729455,
"updateAt": 1757394732274,
"createAt": 1745819764137
}
},
@ -1289,7 +1291,7 @@
"name": "status",
"comment": "",
"dataType": "VARCHAR(20)",
"default": "'normal'",
"default": "'available'",
"options": 8,
"ui": {
"keys": 0,
@ -1299,7 +1301,7 @@
"widthDefault": 60
},
"meta": {
"updateAt": 1755581961537,
"updateAt": 1757394803668,
"createAt": 1745819764137
}
},
@ -2749,7 +2751,7 @@
"name": "status",
"comment": "",
"dataType": "VARCHAR(20)",
"default": "'normal'",
"default": "'available'",
"options": 8,
"ui": {
"keys": 0,
@ -2759,7 +2761,7 @@
"widthDefault": 60
},
"meta": {
"updateAt": 1755592723719,
"updateAt": 1757394742015,
"createAt": 1746409047865
}
},
@ -3929,7 +3931,7 @@
"name": "status",
"comment": "상태",
"dataType": "VARCHAR(20)",
"default": "'normal'",
"default": "'available'",
"options": 8,
"ui": {
"keys": 0,
@ -3939,7 +3941,7 @@
"widthDefault": 60
},
"meta": {
"updateAt": 1755582561756,
"updateAt": 1757394762576,
"createAt": 1748485793994
}
},
@ -8342,6 +8344,26 @@
"updateAt": 1757047738379,
"createAt": 1757047705586
}
},
"zWTlsCCVulhzBhncagMO_": {
"id": "zWTlsCCVulhzBhncagMO_",
"tableId": "IsMoJXzvtuoOFFt93qS0w",
"name": "price",
"comment": "기본금액",
"dataType": "INT",
"default": "0",
"options": 8,
"ui": {
"keys": 0,
"widthName": 60,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1757395574609,
"createAt": 1757395574605
}
}
},
"relationshipEntities": {
@ -8757,7 +8779,7 @@
"wi1XbZM3emknh42sOMkYq"
],
"x": 1691.5679,
"y": 766.3837,
"y": 790.3837,
"direction": 8
},
"meta": {
@ -8981,7 +9003,7 @@
"E30sHnqJytLlBmfL7ueOG"
],
"x": 1950.0679,
"y": 630.3837,
"y": 642.3837,
"direction": 2
},
"meta": {
@ -9065,7 +9087,7 @@
"9FYinSR3C6jDrEsRsCMpl"
],
"x": 1433.0679,
"y": 630.3837,
"y": 642.3837,
"direction": 1
},
"meta": {

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@ class ClientEntity extends CustomerEntity
{
const PK = ClientModel::PK;
const TITLE = ClientModel::TITLE;
const DEFAULT_STATUS = STATUS['NORMAL'];
const DEFAULT_STATUS = STATUS['AVAILABLE'];
//타 객체정의 부분
public function getCode(): string
{

View File

@ -9,7 +9,7 @@ class ServiceEntity extends CustomerEntity
{
const PK = ServiceModel::PK;
const TITLE = ServiceModel::TITLE;
const DEFAULT_STATUS = STATUS['NORMAL'];
const DEFAULT_STATUS = STATUS['AVAILABLE'];
public function setServerEntity(ServerEntity $entity): ServiceEntity
{
$this->attributes['serverEntity'] = $entity;

View File

@ -9,4 +9,12 @@ class CSEntity extends EquipmentEntity
const PK = CSModel::PK;
const TITLE = CSModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
public function getPrice(): int
{
return $this->attributes['price'];
}
public function getCustomTitle(): string
{
return $this->getTitle() . " " . number_format($this->getPrice()) . "";
}
}

View File

@ -13,4 +13,12 @@ class IPEntity extends EquipmentEntity
{
return $this->attributes['ip'];
}
public function getPrice(): int
{
return $this->attributes['price'];
}
public function getCustomTitle(): string
{
return $this->getTitle() . " " . number_format($this->getPrice()) . "";
}
}

View File

@ -20,6 +20,6 @@ class PartEntity extends EquipmentEntity
}
public function getCustomTitle(): string
{
return $this->getTitle() . " " . number_format($this->getPrice()) . ",";
return $this->getTitle() . " " . number_format($this->getPrice()) . "";
}
}

View File

@ -48,4 +48,8 @@ class ServerEntity extends EquipmentEntity
{
return sprintf("[%s] %s", $this->getCode(), $this->getTitle());
}
public function getPrice(): int
{
return $this->attributes['price'];
}
}

View File

@ -14,4 +14,9 @@ class SwitchEntity extends EquipmentEntity
{
return $this->attributes['code'];
}
public function getPrice(): int
{
return $this->attributes['price'];
}
}

View File

@ -9,7 +9,7 @@ class UserEntity extends CommonEntity
{
const PK = Model::PK;
const TITLE = Model::TITLE;
const DEFAULT_STATUS = STATUS['NORMAL'];
const DEFAULT_STATUS = STATUS['AVAILABLE'];
public function getID(): string
{

View File

@ -9,7 +9,7 @@ class UserSNSEntity extends CommonEntity
{
const PK = Model::PK;
const TITLE = Model::TITLE;
const DEFAULT_STATUS = STATUS['NORMAL'];
const DEFAULT_STATUS = STATUS['AVAILABLE'];
//Common Function
public function getParent(): int|null
{

View File

@ -196,6 +196,22 @@ class CommonHelper
return $ips;
}
final public function form_dropdown_common(string $field, mixed $value, array $viewDatas, array $extras = [], array $attributes = []): string
{
// 필터 옵션이 없으면 빈 배열로 초기화
if (!array_key_exists($field, $viewDatas['control']['field_optons'])) {
return ""; // 필터 옵션이 없으면 빈 문자열 반환
}
$extra = "";
foreach ($extras as $extra_tag => $extra_value) {
$extra .= sprintf(" %s=\"%s\"", $extra_tag, htmlspecialchars($extra_value, ENT_QUOTES, 'UTF-8'));
}
// $formOptions는 필터 옵션 배열로, key는 필터 엔티티의 PK, value는 필터 엔티티 객체
$html = sprintf("<select id=\"%s\" name=\"%s\" %s>", $field, $field, $extra);
$html .= $this->form_dropdown_common_process($field, $value, $viewDatas, $extras, $attributes);
$html .= '</select>';
return $html;
}
public function getFieldLabel(string $field, string $label, array $viewDatas, array $extras = []): string
{
@ -208,39 +224,40 @@ class CommonHelper
}
return $label;
}
// header.php에서 getFieldForm_Helper사용
public function form_dropdown_custom(string $field, mixed $value, array $viewDatas, array $extras = []): string
protected function form_dropdown_common_process(string $field, mixed $value, array $viewDatas, array $extras = [], array $attributes = []): string
{
$extra = "";
foreach ($extras as $extra_tag => $extra_value) {
$extra .= sprintf(" %s=\"%s\"", $extra_tag, htmlspecialchars($extra_value, ENT_QUOTES, 'UTF-8'));
}
// 필터 옵션이 없으면 빈 배열로 초기화
if (!array_key_exists($field, $viewDatas['control']['field_optons'])) {
return $field; // 필터 옵션이 없으면 빈 문자열 반환
}
// $formOptions는 필터 옵션 배열로, key는 필터 엔티티의 PK, value는 필터 엔티티 객체
$html = sprintf("<select name=\"%s\" %s>", $field, $extra);
$html .= "<option value=\"\">" . lang("{$viewDatas['class_path']}.label.{$field}") . " 선택" . "</option>";
// echo "{$field}->{$value}";
switch ($field) {
default:
$html = "<option value=\"\">" . lang("{$viewDatas['class_path']}.label.{$field}") . " 선택" . "</option>";
foreach ($viewDatas['control']['field_optons'][$field] as $key => $entity) {
$isSelected = $key == $value ? ' selected' : '';
$isDisabled = $viewDatas['control']['action'] === 'index' && $entity->getStatus() !== $entity::DEFAULT_STATUS ? ' readonly' : '';
$html .= sprintf("<option value=\"%s\"%s%s>%s</option>", $key, $isSelected, $isDisabled, $entity->getCustomTitle());
$attribute = "";
foreach ($attributes as $attribute_tag => $attribute_value) {
switch ($attribute_tag) {
case 'disabled':
$attribute .= in_array($viewDatas['control']['action'], ['create_form', 'index']) && $entity->getStatus() !== ($attribute_value ?? $entity::DEFAULT_STATUS) ? ' disabled' : '';
break;
default:
$attribute .= sprintf(" %s=\"%s\"", $attribute_tag, $entity->$attribute_value);
break;
}
}
$html .= sprintf("<option value=\"%s\"%s%s>%s</option>", $key, $isSelected, $attribute, $entity->getCustomTitle());
}
break;
}
$html .= '</select>';
return $html;
}
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
{
switch ($field) {
case 'email':
$form = form_input($field, $value ?? "", ["placeholder" => "예)test@example.com", ...$extras]);
$form = form_input($field, $value ?? "", ['id' => $field, "placeholder" => "예)test@example.com", ...$extras]);
break;
case 'mobile':
case 'phone':
$form = form_input($field, $value ?? "", ["placeholder" => "예)010-0010-0010", ...$extras]);
$form = form_input($field, $value ?? "", ['id' => $field, "placeholder" => "예)010-0010-0010", ...$extras]);
break;
case 'role':
if (!is_array($viewDatas['control']['field_optons'][$field])) {
@ -253,12 +270,12 @@ class CommonHelper
if ($key !== '') { // 빈값은 제외
$values = is_array($value) ? $value : explode(DEFAULTS["DELIMITER_ROLE"], $value);
//form_check에는 "class" => "form-control" 쓰면 않되거나 form-check를 써야함
$forms[] = form_checkbox("{$field}[]", $key, in_array($key, $values)) . $filterEntity->getTitle();
$forms[] = form_checkbox("{$field}[]", $key, in_array($key, $values), ['id' => $field, ...$extras]) . $filterEntity->getTitle();
}
}
$form = implode(" ", $forms);
} else {
$form = $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
$form = $this->form_dropdown_common($field, $value, $viewDatas, ['id' => $field, ...$extras]);
}
break;
case 'issue_at':
@ -283,13 +300,14 @@ class CommonHelper
case 'serviceinfo_uid':
case 'serverinfo_uid':
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$form = $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
$attributes = ['disabled' => null];
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
break;
default:
if (in_array($field, $viewDatas['control']['actionFilters'])) {
$form = $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras);
} else {
$form = form_input($field, $value ?? "", $extras);
$form = form_input($field, $value ?? "", ['id' => $field, ...$extras]);
}
break;
}
@ -298,9 +316,6 @@ class CommonHelper
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
{
switch ($field) {
case 'user_uid':
$value = array_key_exists($value, $viewDatas['control']['field_optons'][$field]) && $viewDatas['control']['field_optons'][$field][$value] ? $viewDatas['control']['field_optons'][$field][$value]->getTitle() : "";
break;
case 'role':
$roles = [];
foreach (explode(DEFAULTS["DELIMITER_ROLE"], $value) as $key) {
@ -322,6 +337,13 @@ class CommonHelper
case 'amount':
$value = number_format($value) . "";
break;
case 'user_uid':
case 'old_clientinfo_uid':
case 'clientinfo_uid':
case 'serviceinfo_uid':
case 'serverinfo_uid':
$value = array_key_exists($value, $viewDatas['control']['field_optons'][$field]) && $viewDatas['control']['field_optons'][$field][$value] ? $viewDatas['control']['field_optons'][$field][$value]->getTitle() : "";
break;
default:
if (in_array($field, $viewDatas['control']['actionFilters'])) {
//index 액션에서만 filter_options를 변경시 선택된 값을 변경하는 기능
@ -349,8 +371,21 @@ class CommonHelper
public function getListFilter(string $field, mixed $value, array $viewDatas, array $extras = []): string
{
switch ($field) {
case 'user_uid':
case 'old_clientinfo_uid':
case 'clientinfo_uid':
case 'serviceinfo_uid':
case 'serverinfo_uid':
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$attributes = [];
$filter = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
break;
default:
$filter = $this->getFieldForm($field, $value, $viewDatas, $extras);;
if (in_array($field, $viewDatas['control']['actionFilters'])) {
$filter = $this->getFieldForm($field, $value, $viewDatas, $extras);
} else {
$filter = array_key_exists($value, $viewDatas['control']['field_optons'][$field]) ? $viewDatas['control']['field_optons'][$field][$value]->getTitle() : "";
}
break;
}
return $filter;
@ -368,6 +403,7 @@ class CommonHelper
$query .= "order_field={$field}&order_value=";
$query .= isset($viewDatas['order_value']) && $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
$label = anchor(current_url() . "?" . $query, $label);
form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], ['onChange' => 'this.form.submit()']);
break;
}
return $label;

View File

@ -22,11 +22,10 @@ class ServiceHelper extends CustomerHelper
{
switch ($field) {
case 'serverinfo_uid':
if (array_key_exists('entity', $viewDatas)) {
if ($value === null && array_key_exists('entity', $viewDatas)) {
$value = $viewDatas['entity']->getServerEntity()->getPK();
}
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$form = $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
break;
default:
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);

View File

@ -24,10 +24,6 @@ class ServerHelper extends EquipmentHelper
// $extras['readonly'] = in_array($viewDatas['control']['action'], ['modify_form']) ? ' readonly' : '';
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
break;
case 'title':
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$form = $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
break;
case 'manufactur_at':
case 'format_at':
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' calender' : 'calender';

View File

@ -12,21 +12,32 @@ class ServerPartHelper extends EquipmentHelper
parent::__construct();
$this->setTitleField(field: ServerPartModel::TITLE);
}
private function getServerPartForm(string $field, mixed $value, array $viewDatas, array $extras): string
protected function form_dropdown_common_process(string $field, mixed $value, array $viewDatas, array $extras = [], array $attributes = []): string
{
$form = "";
if (array_key_exists('entity', $viewDatas)) {
foreach ($viewDatas['entity']->getServerPartEntities($field) as $serverPartEntity) {
//기존 입력화면에서 return 된것인지?
if ($value === null && $serverPartEntity !== null) {
$value = $serverPartEntity->getPartUID();
switch ($field) {
case 'part_uid':
$html = "<option value=\"\">" . lang("{$viewDatas['class_path']}.label.{$field}") . " 선택" . "</option>";
foreach ($viewDatas['control']['field_optons'][$field] as $key => $entity) {
$isSelected = $key == $value ? ' selected' : '';
$attribute = "";
foreach ($attributes as $attribute_tag => $attribute_value) {
switch ($attribute_tag) {
case 'disabled':
$attribute .= in_array($viewDatas['control']['action'], ['create_form', 'index']) && $entity->getStatus() !== ($attribute_value ?? $entity::DEFAULT_STATUS) ? ' disabled' : '';
break;
default:
$attribute .= sprintf(" %s=\"%s\"", $attribute_tag, $entity->$attribute_value);
break;
}
$form .= $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
}
} else {
$form .= $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
$html .= sprintf("<option value=\"%s\"%s%s>%s</option>", $key, $isSelected, $attribute, $entity->getCustomTitle());
}
return $form;
break;
default:
$html = parent::form_dropdown_common_process($field, $value, $viewDatas, $extras, $attributes);
break;
}
return $html;
}
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
{
@ -40,7 +51,8 @@ class ServerPartHelper extends EquipmentHelper
case 'DB':
case 'OS':
case 'SOFTWARE':
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras);
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras);
break;
case 'CPU_cnt':
case 'RAM_cnt':
@ -60,7 +72,9 @@ class ServerPartHelper extends EquipmentHelper
break;
case 'part_uid':
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
$extras['onChange'] = "document.getElementById('amount').value=this.options[this.selectedIndex].getAttribute('data-price')";
$attributes = ['disabled' => null, 'data-price' => 'getPrice'];
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
break;
default:
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
@ -74,29 +88,6 @@ class ServerPartHelper extends EquipmentHelper
case 'CPU':
case 'RAM':
case 'DISK':
$temps = [];
foreach ($viewDatas['serverPartEntities'] as $partEntity) {
$modal = form_label(
ICONS['SETUP'],
$field,
[
"data-src" => "/admin/equipment/serverpart/modify/{$partEntity->getPK()}?type={$partEntity->getType()}&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"class" => "btn btn-sm btn-outline btn-circle",
"target" => "_self"
]
);
$temps[] = sprintf(
"%s%s*%s개%s",
$modal,
$partEntity->getTitle(),
$partEntity->getCnt(),
$partEntity->getExtra() !== null ? "/" . $partEntity->getExtra() : ""
);
}
$value = implode("<BR>", $temps);
break;
case 'OS':
case 'DB':
case 'SOFTWARE':
@ -117,9 +108,11 @@ class ServerPartHelper extends EquipmentHelper
]
);
$temps[] = sprintf(
"%s%s",
"%s%s*%s개%s",
$modal,
$partEntity->getTitle(),
$partEntity->getCnt(),
!$partEntity->getExtra() ? "" : "/" . $partEntity->getExtra()
);
}
$value = implode("<BR>", $temps);
@ -151,7 +144,7 @@ class ServerPartHelper extends EquipmentHelper
$label ? $label : ICONS['SETUP'],
$action,
[
"data-src" => "/admin/equipment/serverpart?serverinfo_uid={$viewDatas['serverinfo_uid']}&type={$action}&ActionTemplate=popup",
"data-src" => "/admin/equipment/serverpart/create?serverinfo_uid={$viewDatas['serverinfo_uid']}&type={$action}&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
...$extras,

View File

@ -28,7 +28,7 @@ return [
"reseller" => "리셀러",
],
"STATUS" => [
STATUS['NORMAL'] => "사용중",
STATUS['AVAILABLE'] => "사용중",
STATUS['PAUSE'] => "일시정지",
STATUS['TERMINATED'] => "해지",
],

View File

@ -40,7 +40,7 @@ return [
"colocation" => "코로케이션",
],
"STATUS" => [
STATUS['NORMAL'] => "사용중",
STATUS['AVAILABLE'] => "사용중",
STATUS['PAUSE'] => "일시정지",
STATUS['TERMINATED'] => "해지",
],

View File

@ -11,7 +11,6 @@ return [
'accountid' => "계정ID",
'domain' => "도메인",
'price' => "기본가",
'amount' => "제공가",
'status' => "상태",
'updated_at' => "수정일",
'created_at' => "작성일",

View File

@ -8,7 +8,6 @@ return [
'serverinfo_uid' => '서버정보',
'ip' => "IP",
'price' => "기본가",
'amount' => "제공가",
'history' => "사용내역",
'status' => "상태",
'updated_at' => "수정일",

View File

@ -5,7 +5,6 @@ return [
'type' => "종류",
'title' => "모델명",
'price' => "기본가",
'amount' => "제공가",
'status' => "상태",
'updated_at' => "수정일",
'created_at' => "작성일",

View File

@ -15,17 +15,6 @@ return [
'created_at' => "작성일",
'deleted_at' => "삭제일",
"serverpartinfo" => "부품정보",
"ipinfo_uid" => "IP정보",
"csinfo_uid" => "CS정보",
'CPU' => "CPU",
'CPU_cnt' => "CPU갯수",
'RAM' => "RAM",
'RAM_cnt' => "RAM갯수",
'DISK' => "DISK",
'DISK_extra' => "RAID설정",
'OS' => "OS",
'DB' => "DB",
'SOFTWARE' => "기타SW",
],
"TITLE" => [
'HP DL360 Gen6' => "HP DL360 Gen6",

View File

@ -2,10 +2,11 @@
return [
'title' => "Switch정보",
'label' => [
'code' => "코드",
'clientinfo_uid' => "고객",
'serviceinfo_uid' => "서비스",
'serverinfo_uid' => "서버",
'code' => "코드",
'price' => "기본가",
'status' => "사용여부",
'updated_at' => "수정일",
'created_at' => "작성일",

View File

@ -24,7 +24,7 @@ return [
"master" => "마스터",
],
"STATUS" => [
STATUS['NORMAL'] => "사용중",
STATUS['AVAILABLE'] => "사용중",
STATUS['PAUSE'] => "일시정지",
STATUS['TERMINATED'] => "해지",
],

View File

@ -21,7 +21,6 @@ class CSModel extends EquipmentModel
"accountid",
"domain",
"price",
'amount',
"status",
"updated_at"
];
@ -42,7 +41,7 @@ class CSModel extends EquipmentModel
$rule = "required|trim|valid_ip[both]"; //ipv4 , ipv6 , both(ipv4,ipv6)
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[" . $this->getTable() . "." . $field . "]" : "";
break;
case "amount":
case "price":
$rule = "required|numeric";
break;
case "accountid":

View File

@ -20,7 +20,6 @@ class IPModel extends EquipmentModel
"serverinfo_uid",
"ip",
"price",
"amount",
"status",
"updated_at"
];
@ -36,7 +35,6 @@ class IPModel extends EquipmentModel
switch ($field) {
case "lineinfo_uid":
case "price":
case "amount":
$rule = "required|numeric";
break;
case "old_clientinfo_uid":

View File

@ -18,6 +18,7 @@ class SwitchModel extends EquipmentModel
"serviceinfo_uid",
"serverinfo_uid",
"code",
"price",
"status",
"updated_at"
];
@ -34,6 +35,9 @@ class SwitchModel extends EquipmentModel
case "status":
$rule = "required|trim|string";
break;
case "price":
$rule = "permit_empty|numeric";
break;
default:
$rule = parent::getFormRule($action, $field);
break;

View File

@ -3,8 +3,6 @@
namespace App\Services\Equipment;
use App\Models\Equipment\CSModel;
use App\Entities\Equipment\ServerEntity;
use App\Entities\Equipment\CSEntity;
class CSService extends EquipmentService
{
@ -22,7 +20,6 @@ class CSService extends EquipmentService
"accountid",
"domain",
"price",
"amount",
"status",
];
}
@ -45,7 +42,6 @@ class CSService extends EquipmentService
'accountid',
'domain',
'price',
"amount",
'status',
];
}

View File

@ -24,7 +24,6 @@ class IPService extends EquipmentService
"serverinfo_uid",
"ip",
"price",
"amount",
"status",
];
}
@ -44,7 +43,6 @@ class IPService extends EquipmentService
'lineinfo_uid',
'ip',
'price',
"amount",
'status',
'clientinfo_uid',
'serverinfo_uid',

View File

@ -19,6 +19,7 @@ class SwitchService extends EquipmentService
return [
"serverinfo_uid",
"code",
"price",
"status",
];
}
@ -37,6 +38,7 @@ class SwitchService extends EquipmentService
'clientinfo_uid',
'serviceinfo_uid',
'serverinfo_uid',
"price",
'status',
];
}