dbmsv2_init...1

This commit is contained in:
choi.jh 2025-09-23 19:13:22 +09:00
parent b50267cdf8
commit 71992be4ac
11 changed files with 20 additions and 20 deletions

View File

@ -49,4 +49,11 @@ class ServerController extends EquipmentController
}
return $result;
}
protected function create_form_process(): void
{
$formDatas = $this->getService()->getFormDatas();
$formDatas['code'] = sprintf("%d%dXX-M%d", date("y"), ceil((int)date("m") / 3), $this->getService()->getLatestPK());
$this->getService()->setFormDatas($formDatas);
parent::create_form_process();
}
}

View File

@ -2,8 +2,6 @@
namespace App\Controllers\Admin\Equipment;
use App\Entities\Equipment\SwitchEntity;
use App\Helpers\Equipment\SwitchHelper;
use App\Services\Equipment\SwitchService;
use CodeIgniter\HTTP\RequestInterface;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -446,7 +446,7 @@ class CommonHelper
"checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids)
]);
$action = $checkbox . form_label(
$label ? $label : $viewDatas['cnt'],
$label,
$action,
[
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(),

View File

@ -19,7 +19,6 @@ return [
"TYPE" => [
'HP' => "HP",
"INTEL" => "INTEL",
"AMD" => "AMD",
],
"TITLE" => [
"HP DL360 Gen6" => "HP DL360 Gen6",
@ -32,9 +31,6 @@ return [
"INTEL I5" => "INTEL I5",
"INTEL I7" => "INTEL I7",
"INTEL I9" => "INTEL I9",
"AMD Z2" => "AMD Ryzen Z2",
"AMD AI-5" => "AMD AI-5",
"AMD Threadripper" => "AMD Threadripper",
],
"STATUS" => [
STATUS['AVAILABLE'] => "사용가능",

View File

@ -80,10 +80,4 @@ class ServerModel extends EquipmentModel
return $value;
}
//기본기능
//입력전 임시코드처리
public function create(array $formDatas): ServerEntity
{
$formDatas['code'] = "m" . uniqid();
return parent::create($formDatas);
}
}

View File

@ -218,6 +218,11 @@ abstract class CommonService
}
return $this->_clientService;
}
final public function getLatestPK(): int
{
$row = $this->getModel()->selectMax($this->getModel()->getPKField())->get()->getRow();
return isset($row->uid) ? ((int)$row->uid + 1) : 1;
}
//기본 기능부분
//FieldForm관련용
final public function getFormDatas(): array

View File

@ -3,6 +3,7 @@
namespace App\Services\Equipment;
use App\Entities\Equipment\ServerEntity;
use App\Entities\Equipment\ServerPartEntity;
use App\Helpers\Equipment\ServerHelper;
use App\Models\Equipment\ServerModel;
use App\Services\Customer\ServiceService;
@ -20,12 +21,12 @@ class ServerService extends EquipmentService
public function getFormFields(): array
{
return [
"code",
"type",
"title",
"price",
"manufactur_at",
"format_at",
"status",
];
}
public function getFormFilters(): array

View File

@ -19,7 +19,6 @@ class SwitchService extends EquipmentService
public function getFormFields(): array
{
return [
"serverinfo_uid",
"code",
"price",
"status",

View File

@ -11,7 +11,7 @@
<tr>
<td nowrap>
<table class="table table-bordered">
<?php foreach (["code", "type", "title", "price", "manufactur_at", "format_at", "status",] as $field): ?>
<?php foreach ($viewDatas['control']['actionFields'] as $field): ?>
<tr>
<th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<td nowrap class="text-start"><?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field ?? null, $viewDatas) ?></td>