dbmsv2_init...1
This commit is contained in:
parent
b50267cdf8
commit
71992be4ac
@ -49,4 +49,11 @@ class ServerController extends EquipmentController
|
|||||||
}
|
}
|
||||||
return $result;
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin\Equipment;
|
namespace App\Controllers\Admin\Equipment;
|
||||||
|
|
||||||
use App\Entities\Equipment\SwitchEntity;
|
|
||||||
use App\Helpers\Equipment\SwitchHelper;
|
|
||||||
use App\Services\Equipment\SwitchService;
|
use App\Services\Equipment\SwitchService;
|
||||||
|
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
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
@ -446,7 +446,7 @@ class CommonHelper
|
|||||||
"checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids)
|
"checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids)
|
||||||
]);
|
]);
|
||||||
$action = $checkbox . form_label(
|
$action = $checkbox . form_label(
|
||||||
$label ? $label : $viewDatas['cnt'],
|
$label,
|
||||||
$action,
|
$action,
|
||||||
[
|
[
|
||||||
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(),
|
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(),
|
||||||
|
|||||||
@ -19,7 +19,6 @@ return [
|
|||||||
"TYPE" => [
|
"TYPE" => [
|
||||||
'HP' => "HP",
|
'HP' => "HP",
|
||||||
"INTEL" => "INTEL",
|
"INTEL" => "INTEL",
|
||||||
"AMD" => "AMD",
|
|
||||||
],
|
],
|
||||||
"TITLE" => [
|
"TITLE" => [
|
||||||
"HP DL360 Gen6" => "HP DL360 Gen6",
|
"HP DL360 Gen6" => "HP DL360 Gen6",
|
||||||
@ -32,9 +31,6 @@ return [
|
|||||||
"INTEL I5" => "INTEL I5",
|
"INTEL I5" => "INTEL I5",
|
||||||
"INTEL I7" => "INTEL I7",
|
"INTEL I7" => "INTEL I7",
|
||||||
"INTEL I9" => "INTEL I9",
|
"INTEL I9" => "INTEL I9",
|
||||||
"AMD Z2" => "AMD Ryzen Z2",
|
|
||||||
"AMD AI-5" => "AMD AI-5",
|
|
||||||
"AMD Threadripper" => "AMD Threadripper",
|
|
||||||
],
|
],
|
||||||
"STATUS" => [
|
"STATUS" => [
|
||||||
STATUS['AVAILABLE'] => "사용가능",
|
STATUS['AVAILABLE'] => "사용가능",
|
||||||
|
|||||||
@ -80,10 +80,4 @@ class ServerModel extends EquipmentModel
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
//기본기능
|
//기본기능
|
||||||
//입력전 임시코드처리
|
|
||||||
public function create(array $formDatas): ServerEntity
|
|
||||||
{
|
|
||||||
$formDatas['code'] = "m" . uniqid();
|
|
||||||
return parent::create($formDatas);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -218,6 +218,11 @@ abstract class CommonService
|
|||||||
}
|
}
|
||||||
return $this->_clientService;
|
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관련용
|
//FieldForm관련용
|
||||||
final public function getFormDatas(): array
|
final public function getFormDatas(): array
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
namespace App\Services\Equipment;
|
namespace App\Services\Equipment;
|
||||||
|
|
||||||
use App\Entities\Equipment\ServerEntity;
|
use App\Entities\Equipment\ServerEntity;
|
||||||
|
use App\Entities\Equipment\ServerPartEntity;
|
||||||
use App\Helpers\Equipment\ServerHelper;
|
use App\Helpers\Equipment\ServerHelper;
|
||||||
use App\Models\Equipment\ServerModel;
|
use App\Models\Equipment\ServerModel;
|
||||||
use App\Services\Customer\ServiceService;
|
use App\Services\Customer\ServiceService;
|
||||||
@ -20,12 +21,12 @@ class ServerService extends EquipmentService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
"code",
|
||||||
"type",
|
"type",
|
||||||
"title",
|
"title",
|
||||||
"price",
|
"price",
|
||||||
"manufactur_at",
|
"manufactur_at",
|
||||||
"format_at",
|
"format_at",
|
||||||
"status",
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getFormFilters(): array
|
public function getFormFilters(): array
|
||||||
|
|||||||
@ -19,7 +19,6 @@ class SwitchService extends EquipmentService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
"serverinfo_uid",
|
|
||||||
"code",
|
"code",
|
||||||
"price",
|
"price",
|
||||||
"status",
|
"status",
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<table class="table table-bordered">
|
<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>
|
<tr>
|
||||||
<th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
|
<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>
|
<td nowrap class="text-start"><?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field ?? null, $viewDatas) ?></td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user