dbmsv4 init...1
This commit is contained in:
parent
caa933d565
commit
224bcb11a6
@ -7,7 +7,7 @@ use ReflectionNamedType;
|
||||
|
||||
abstract class CommonDTO
|
||||
{
|
||||
public function __construct(array $datas = [])
|
||||
protected function __construct(array $datas = [])
|
||||
{
|
||||
// 데이터가 없으면 바로 리턴
|
||||
if (empty($datas)) {
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace App\DTOs\Customer;
|
||||
|
||||
use App\DTOs\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();
|
||||
}
|
||||
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
|
||||
{
|
||||
switch ($field) {
|
||||
|
||||
@ -69,7 +69,16 @@ class PaymentService extends CommonService
|
||||
break;
|
||||
case 'modify':
|
||||
case 'modify_form':
|
||||
$fields = ['title', 'amount', 'pay', 'status', 'content'];
|
||||
$fields = [
|
||||
"serviceinfo_uid",
|
||||
"title",
|
||||
"amount",
|
||||
"billing",
|
||||
"billing_at",
|
||||
"pay",
|
||||
"status",
|
||||
"content"
|
||||
];
|
||||
break;
|
||||
case 'view':
|
||||
$fields = [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user