dbmsv4 init...1
This commit is contained in:
parent
caa933d565
commit
224bcb11a6
@ -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)) {
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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 ?? "";
|
|
||||||
} //
|
|
||||||
}
|
|
||||||
@ -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) {
|
||||||
|
|||||||
@ -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 = [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user