dbmsv4 init...1

This commit is contained in:
최준흠 2025-11-21 13:52:01 +09:00
parent caa933d565
commit 224bcb11a6
5 changed files with 31 additions and 33 deletions

View File

@ -7,7 +7,7 @@ use ReflectionNamedType;
abstract class CommonDTO abstract class CommonDTO
{ {
public function __construct(array $datas = []) protected function __construct(array $datas = [])
{ {
// 데이터가 없으면 바로 리턴 // 데이터가 없으면 바로 리턴
if (empty($datas)) { if (empty($datas)) {

View File

@ -1,5 +1,7 @@
<?php <?php
namespace App\DTOs\Customer;
use App\DTOs\CommonDTO; use App\DTOs\CommonDTO;
class ClientDTO extends CommonDTO class ClientDTO extends CommonDTO

View File

@ -1,30 +0,0 @@
<?php
namespace App\Helpers;
class CollectorHelper extends CommonHelper
{
public function __construct()
{
parent::__construct();
}
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string
{
switch ($field) {
case 'in':
case 'out':
case 'raw_in':
case 'raw_out':
$value = number_format($value);
break;
case 'updated_at':
case 'created_at':
case 'deleted_at':
break;
default:
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
break;
}
return $value ?? "";
} //
}

View File

@ -8,6 +8,23 @@ class PaymentHelper extends CommonHelper
{ {
parent::__construct(); parent::__construct();
} }
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
{
switch ($field) {
case 'billing':
case 'pay':
$forms = [];
array_shift($viewDatas['formOptions'][$field]['options']);
foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label)
$forms[] = form_radio($field, $key, $key == $value, $extras) . $label;
$form = implode(" ", $forms);
break;
default:
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
break;
}
return $form;
} //
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
{ {
switch ($field) { switch ($field) {

View File

@ -58,7 +58,7 @@ class PaymentService extends CommonService
"amount", "amount",
"billing", "billing",
"billing_at", "billing_at",
"content ", "content",
]; ];
$filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay']; $filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
$indexFilter = ['serviceinfo_uid', 'status', 'billing']; $indexFilter = ['serviceinfo_uid', 'status', 'billing'];
@ -69,7 +69,16 @@ class PaymentService extends CommonService
break; break;
case 'modify': case 'modify':
case 'modify_form': case 'modify_form':
$fields = ['title', 'amount', 'pay', 'status', 'content']; $fields = [
"serviceinfo_uid",
"title",
"amount",
"billing",
"billing_at",
"pay",
"status",
"content"
];
break; break;
case 'view': case 'view':
$fields = [ $fields = [