dbms_init...1

This commit is contained in:
최준흠 2025-05-08 19:04:51 +09:00
parent e26d2c1d12
commit f62fece95e
9 changed files with 10 additions and 18 deletions

View File

@ -95,7 +95,6 @@ define('EVENT_PRIORITY_HIGH', 10);
//Default값 정의 //Default값 정의
define('DEFAULTS', [ define('DEFAULTS', [
'EMPTY' => "",
'DELIMITER_FILE' => "||", 'DELIMITER_FILE' => "||",
'DELIMITER_ROLE' => ",", 'DELIMITER_ROLE' => ",",
]); ]);

View File

@ -429,11 +429,7 @@ abstract class CommonController extends BaseController
//조건절 처리 //조건절 처리
foreach ($filter_fields as $field) { foreach ($filter_fields as $field) {
$this->$field = $this->request->getVar($field); $this->$field = $this->request->getVar($field);
echo "<BR>";
echo "1{$field}:{$this->$field}";
echo "<BR>";
if (!is_null($this->$field)) { if (!is_null($this->$field)) {
echo "2{$field}:{$this->$field}";
$this->getService()->getModel()->where($this->getService()->getModel()->getTable() . '.' . $field, $this->$field); $this->getService()->getModel()->where($this->getService()->getModel()->getTable() . '.' . $field, $this->$field);
} }
} }
@ -488,12 +484,12 @@ abstract class CommonController extends BaseController
//Pagination 처리 //Pagination 처리
$this->pagination = $this->getPaginationForList(); $this->pagination = $this->getPaginationForList();
//OrderBy 처리 //OrderBy 처리
$this->order_field = $this->request->getVar('order_field') ?? DEFAULTS['EMPTY']; $this->order_field = $this->request->getVar('order_field');
$this->order_value = $this->request->getVar('order_value') ?? DEFAULTS['EMPTY']; $this->order_value = $this->request->getVar('order_value');
if ($this->order_field !== DEFAULTS['EMPTY'] && $this->order_value !== DEFAULTS['EMPTY']) { if ($this->order_field && $this->order_value) {
$this->getService()->getModel()->orderBy(sprintf("%s.%s %s", $this->getService()->getModel()::TABLE, $this->order_field, $this->order_value)); $this->getService()->getModel()->orderBy(sprintf("%s.%s %s", $this->getService()->getModel()->getTable(), $this->order_field, $this->order_value));
} else { } else {
$this->getService()->getModel()->orderBy(sprintf("%s.%s %s", $this->getService()->getModel()::TABLE, $this->getService()->getModel()::PK, "DESC")); $this->getService()->getModel()->orderBy(sprintf("%s.%s %s", $this->getService()->getModel()->getTable(), $this->getService()->getModel()->getPKField(), "DESC"));
} }
$this->getService()->getModel()->limit($this->per_page); $this->getService()->getModel()->limit($this->per_page);
$this->getService()->getModel()->offset(($this->page - 1) * $this->per_page); $this->getService()->getModel()->offset(($this->page - 1) * $this->per_page);

View File

@ -18,7 +18,6 @@ class AuthHelper extends CommonHelper
if (in_array($viewDatas['action'], ['create', 'modify'])) { if (in_array($viewDatas['action'], ['create', 'modify'])) {
$extras = (strpos($viewDatas['field_rules'][$field], 'required') !== false) ? ["class" => "form-control", "required" => "", ...$extras] : ["class" => "form-control", ...$extras]; $extras = (strpos($viewDatas['field_rules'][$field], 'required') !== false) ? ["class" => "form-control", "required" => "", ...$extras] : ["class" => "form-control", ...$extras];
} }
$value = $value ?? DEFAULTS['EMPTY'];
switch ($field) { switch ($field) {
case 'id': case 'id':
case 'passwd': case 'passwd':

View File

@ -184,7 +184,6 @@ class CommonHelper
if (in_array($viewDatas['action'], ['create', 'modify'])) { if (in_array($viewDatas['action'], ['create', 'modify'])) {
$extras = (strpos($viewDatas['field_rules'][$field], 'required') !== false) ? ["class" => "form-control", "required" => "", ...$extras] : ["class" => "form-control", ...$extras]; $extras = (strpos($viewDatas['field_rules'][$field], 'required') !== false) ? ["class" => "form-control", "required" => "", ...$extras] : ["class" => "form-control", ...$extras];
} }
$value = $value ?? DEFAULTS['EMPTY'];
switch ($field) { switch ($field) {
case 'email': case 'email':
$form = form_input($field, $value, ["placeholder" => "예)test@example.com", ...$extras]); $form = form_input($field, $value, ["placeholder" => "예)test@example.com", ...$extras]);
@ -239,7 +238,7 @@ class CommonHelper
public function getFieldView(string $field, array $viewDatas, array $extras = []): string public function getFieldView(string $field, array $viewDatas, array $extras = []): string
{ {
$value = $viewDatas['entity']->$field ?? DEFAULTS['EMPTY']; $value = $viewDatas['entity']->$field;
switch ($field) { switch ($field) {
case $this->getTitleField(): case $this->getTitleField():
$value = form_label( $value = form_label(
@ -300,6 +299,7 @@ class CommonHelper
{ {
return $entity->isMatched($field, $value) ? "" : 'class="table-danger"'; return $entity->isMatched($field, $value) ? "" : 'class="table-danger"';
} }
public function getListLabel(string $field, array $viewDatas, array $extras = []): string public function getListLabel(string $field, array $viewDatas, array $extras = []): string
{ {
switch ($field) { switch ($field) {

View File

@ -15,7 +15,7 @@ class ClientHelper extends CustomerHelper
} }
public function getFieldView(string $field, array $viewDatas, array $extras = []): string public function getFieldView(string $field, array $viewDatas, array $extras = []): string
{ {
$value = $viewDatas['entity']->$field ?? DEFAULTS['EMPTY']; $value = $viewDatas['entity']->$field;
switch ($field) { switch ($field) {
case 'account_balance': case 'account_balance':
case 'coupon_balance': case 'coupon_balance':

View File

@ -16,7 +16,6 @@ class DeviceHelper extends CommonHelper
if (in_array($viewDatas['action'], ['create', 'modify'])) { if (in_array($viewDatas['action'], ['create', 'modify'])) {
$extras = (strpos($viewDatas['field_rules'][$field], 'required') !== false) ? ["class" => "form-control", "required" => "", ...$extras] : ["class" => "form-control", ...$extras]; $extras = (strpos($viewDatas['field_rules'][$field], 'required') !== false) ? ["class" => "form-control", "required" => "", ...$extras] : ["class" => "form-control", ...$extras];
} }
$value = $value ?? DEFAULTS['EMPTY'];
switch ($field) { switch ($field) {
case "serverinfo_uid": case "serverinfo_uid":
if (!is_array($viewDatas['field_options'][$field])) { if (!is_array($viewDatas['field_options'][$field])) {

View File

@ -16,7 +16,7 @@ class MyLogHelper extends CommonHelper
public function getFieldView(string $field, array $viewDatas, array $extras = []): string public function getFieldView(string $field, array $viewDatas, array $extras = []): string
{ {
$value = $viewDatas['entity']->$field ?? DEFAULTS['EMPTY']; $value = $viewDatas['entity']->$field;
switch ($field) { switch ($field) {
case 'content': case 'content':
$value = nl2br($value); $value = nl2br($value);

View File

@ -18,7 +18,6 @@ class UserHelper extends CommonHelper
if (in_array($viewDatas['action'], ['create', 'modify'])) { if (in_array($viewDatas['action'], ['create', 'modify'])) {
$extras = (strpos($viewDatas['field_rules'][$field], 'required') !== false) ? ["class" => "form-control", "required" => "", ...$extras] : ["class" => "form-control", ...$extras]; $extras = (strpos($viewDatas['field_rules'][$field], 'required') !== false) ? ["class" => "form-control", "required" => "", ...$extras] : ["class" => "form-control", ...$extras];
} }
$value = $value ?? DEFAULTS['EMPTY'];
switch ($field) { switch ($field) {
case 'passwd': case 'passwd':
case 'confirmpassword': case 'confirmpassword':

View File

@ -2,7 +2,7 @@
<ul class="nav justify-content-center"> <ul class="nav justify-content-center">
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li> <li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
<?php foreach ($viewDatas['batchjob_fields'] as $field): ?> <?php foreach ($viewDatas['batchjob_fields'] as $field): ?>
<?= $viewDatas['helper']->getFieldForm($field, DEFAULTS['EMPTY'], $viewDatas, ['data-batchjob' => 'true']) ?> <?= $viewDatas['helper']->getFieldForm($field, null, $viewDatas, ['data-batchjob' => 'true']) ?>
<?php endforeach ?> <?php endforeach ?>
<li class="nav-item"><?= $viewDatas['helper']->getListButton('batchjob', $viewDatas) ?></li> <li class="nav-item"><?= $viewDatas['helper']->getListButton('batchjob', $viewDatas) ?></li>
<li class="nav-item"><?= $viewDatas['helper']->getListButton('create', $viewDatas) ?></li> <li class="nav-item"><?= $viewDatas['helper']->getListButton('create', $viewDatas) ?></li>