dbmsv4 init...3
This commit is contained in:
parent
8f6ee9c541
commit
eaa33ac5d0
@ -11,7 +11,7 @@ class ServiceCell extends CustomerCell
|
|||||||
|
|
||||||
public function detail(array $params): string
|
public function detail(array $params): string
|
||||||
{
|
{
|
||||||
$this->getService()->action_init_process(__FUNCTION__);
|
$this->getService()->getFormService()->action_init_process(__FUNCTION__);
|
||||||
//서비스별 미납 Count
|
//서비스별 미납 Count
|
||||||
$unPaids = service('paymentservice')->getUnPaids('serviceinfo_uid', ['clientinfo_uid' => $params['clientinfo_uid']]);
|
$unPaids = service('paymentservice')->getUnPaids('serviceinfo_uid', ['clientinfo_uid' => $params['clientinfo_uid']]);
|
||||||
//서비스별 서버리스트
|
//서비스별 서버리스트
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class ServerCell extends EquipmentCell
|
|||||||
}
|
}
|
||||||
public function detail(array $params): string
|
public function detail(array $params): string
|
||||||
{
|
{
|
||||||
$this->getService()->action_init_process(__FUNCTION__);
|
$this->getService()->getFormService()->action_init_process(__FUNCTION__);
|
||||||
if (!array_key_exists('serviceEntity', $params)) {
|
if (!array_key_exists('serviceEntity', $params)) {
|
||||||
return static::class . '->' . __FUNCTION__ . "에서 오류발생: 서비스 정보가 정의되지 않았습니다.";
|
return static::class . '->' . __FUNCTION__ . "에서 오류발생: 서비스 정보가 정의되지 않았습니다.";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class ServerPartCell extends EquipmentCell
|
|||||||
|
|
||||||
public function parttable(array $params): string
|
public function parttable(array $params): string
|
||||||
{
|
{
|
||||||
$this->getService()->action_init_process(__FUNCTION__);
|
$this->getService()->getFormService()->action_init_process(__FUNCTION__);
|
||||||
if (!array_key_exists('serverinfo_uid', $params)) {
|
if (!array_key_exists('serverinfo_uid', $params)) {
|
||||||
return "서버정보를 정의하셔야합니다.";
|
return "서버정보를 정의하셔야합니다.";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class MylogCell extends CommonCell
|
|||||||
|
|
||||||
public function dashboard(array $params): string
|
public function dashboard(array $params): string
|
||||||
{
|
{
|
||||||
$this->getService()->action_init_process(__FUNCTION__);
|
$this->getService()->getFormService()->action_init_process(__FUNCTION__);
|
||||||
$this->getService()->setLimit(20);
|
$this->getService()->setLimit(20);
|
||||||
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
||||||
return view('cells/mylog/' . $template, [
|
return view('cells/mylog/' . $template, [
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class DISKCell extends PartCell
|
|||||||
|
|
||||||
public function stock(array $params): string
|
public function stock(array $params): string
|
||||||
{
|
{
|
||||||
$this->getService()->action_init_process(__FUNCTION__);
|
$this->getService()->getFormService()->action_init_process(__FUNCTION__);
|
||||||
$template = array_key_exists('template', $params) ? $params['template'] : 'disk_stock';
|
$template = array_key_exists('template', $params) ? $params['template'] : 'disk_stock';
|
||||||
return view('cells/part/' . $template, [
|
return view('cells/part/' . $template, [
|
||||||
'partCellDatas' => [
|
'partCellDatas' => [
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class PaymentCell extends CommonCell
|
|||||||
|
|
||||||
public function detail(array $params): string
|
public function detail(array $params): string
|
||||||
{
|
{
|
||||||
$this->getService()->action_init_process(__FUNCTION__);
|
$this->getService()->getFormService()->action_init_process(__FUNCTION__);
|
||||||
$entities = $this->getService()->getEntities(['clientinfo_uid' => $params['clientinfo_uid'], 'billing' => PAYMENT['BILLING']['ONETIME'], 'status' => STATUS['UNPAID']]);
|
$entities = $this->getService()->getEntities(['clientinfo_uid' => $params['clientinfo_uid'], 'billing' => PAYMENT['BILLING']['ONETIME'], 'status' => STATUS['UNPAID']]);
|
||||||
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
||||||
return view('cells/payment/' . $template, [
|
return view('cells/payment/' . $template, [
|
||||||
|
|||||||
@ -19,11 +19,11 @@ abstract class AdminController extends CommonController
|
|||||||
}
|
}
|
||||||
protected function action_init_process(string $action, array $formDatas = []): void
|
protected function action_init_process(string $action, array $formDatas = []): void
|
||||||
{
|
{
|
||||||
$this->service->action_init_process($action, $formDatas);
|
|
||||||
parent::action_init_process($action, $formDatas);
|
parent::action_init_process($action, $formDatas);
|
||||||
$this->addViewDatas('layout', $this->layouts);
|
$this->addViewDatas('layout', $this->layouts);
|
||||||
$this->addViewDatas('title', $this->getTitle());
|
$this->addViewDatas('title', $this->getTitle());
|
||||||
$this->addViewDatas('helper', $this->service->getHelper());
|
$this->addViewDatas('helper', $this->service->getHelper());
|
||||||
|
$this->service->getFormService()->action_init_process($action, $formDatas);
|
||||||
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
|
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
|
||||||
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
|
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
|
||||||
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
|
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin\Customer\Wallet;
|
namespace App\Controllers\Admin\Customer\Wallet;
|
||||||
|
|
||||||
|
use App\Entities\Customer\ClientEntity;
|
||||||
use CodeIgniter\HTTP\RedirectResponse;
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
@ -24,17 +25,17 @@ class AccountController extends WalletController
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$uid = $this->request->getVar('clientinfo_uid');
|
$uid = $this->request->getVar('clientinfo_uid');
|
||||||
if (!$uid) {
|
$clientEntity = null;
|
||||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 고객정보 번호가 정의되지 않았습니다..");
|
if ($uid) {
|
||||||
}
|
|
||||||
$clientEntity = service('customer_clientservice')->getEntity($uid);
|
$clientEntity = service('customer_clientservice')->getEntity($uid);
|
||||||
if (!$clientEntity) {
|
if (!$clientEntity) {
|
||||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$uid}에 해당하는 고객정보을 찾을수 없습니다.");
|
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$uid}에 해당하는 고객정보을 찾을수 없습니다.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$action = __FUNCTION__;
|
$action = __FUNCTION__;
|
||||||
$formDatas = [];
|
$formDatas = [];
|
||||||
$formDatas['clientinfo_uid'] = $uid;
|
$formDatas['clientinfo_uid'] = $uid;
|
||||||
$formDatas['alias'] = $clientEntity->getTitle();
|
$formDatas['alias'] = $clientEntity instanceof ClientEntity ? $clientEntity->getTitle() : "";
|
||||||
$formDatas['issue_at'] = date('Y-m-d');
|
$formDatas['issue_at'] = date('Y-m-d');
|
||||||
$this->action_init_process($action, $formDatas);
|
$this->action_init_process($action, $formDatas);
|
||||||
$this->addViewDatas('formDatas', $formDatas);
|
$this->addViewDatas('formDatas', $formDatas);
|
||||||
|
|||||||
@ -22,10 +22,10 @@ class Home extends AbstractWebController
|
|||||||
}
|
}
|
||||||
protected function action_init_process(string $action, array $formDatas = []): void
|
protected function action_init_process(string $action, array $formDatas = []): void
|
||||||
{
|
{
|
||||||
$this->service->action_init_process($action, $formDatas);
|
|
||||||
parent::action_init_process($action, $formDatas);
|
parent::action_init_process($action, $formDatas);
|
||||||
$this->addViewDatas('layout', $this->layouts);
|
$this->addViewDatas('layout', $this->layouts);
|
||||||
$this->addViewDatas('helper', $this->service->getHelper());
|
$this->addViewDatas('helper', $this->service->getHelper());
|
||||||
|
$this->service->getFormService()->action_init_process($action, $formDatas);
|
||||||
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
|
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
|
||||||
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
|
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
|
||||||
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
|
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
|
||||||
|
|||||||
@ -21,10 +21,11 @@ abstract class AuthController extends AbstractWebController
|
|||||||
}
|
}
|
||||||
protected function action_init_process(string $action, array $formDatas = []): void
|
protected function action_init_process(string $action, array $formDatas = []): void
|
||||||
{
|
{
|
||||||
$this->service->action_init_process($action, $formDatas);
|
|
||||||
parent::action_init_process($action, $formDatas);
|
parent::action_init_process($action, $formDatas);
|
||||||
$this->addViewDatas('layout', $this->layouts);
|
$this->addViewDatas('layout', $this->layouts);
|
||||||
$this->addViewDatas('helper', $this->service->getHelper());
|
$this->addViewDatas('helper', $this->service->getHelper());
|
||||||
|
//Fields,Rules,Filters,Options등 초기화
|
||||||
|
$this->service->getFormService()->action_init_process($action, $formDatas);
|
||||||
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
|
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
|
||||||
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
|
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
|
||||||
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
|
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
|
||||||
|
|||||||
@ -25,7 +25,6 @@ class LocalController extends AuthController
|
|||||||
//로그인처리
|
//로그인처리
|
||||||
protected function login_process(): UserEntity
|
protected function login_process(): UserEntity
|
||||||
{
|
{
|
||||||
$this->action_init_process('login');
|
|
||||||
return $this->service->login(new LocalDTO($this->request->getPost()));
|
return $this->service->login(new LocalDTO($this->request->getPost()));
|
||||||
}
|
}
|
||||||
protected function logout_process(): void
|
protected function logout_process(): void
|
||||||
|
|||||||
@ -59,7 +59,7 @@ abstract class CommonDTO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __get(string $name)
|
public function __get(string $name): mixed
|
||||||
{
|
{
|
||||||
// 1. 속성이 클래스에 실제로 존재하는지 확인
|
// 1. 속성이 클래스에 실제로 존재하는지 확인
|
||||||
if (property_exists($this, $name)) {
|
if (property_exists($this, $name)) {
|
||||||
|
|||||||
@ -38,25 +38,24 @@ class ClientDTO extends CommonDTO
|
|||||||
/**
|
/**
|
||||||
* role 속성을 읽을 때 자동으로 배열로 변환해서 반환
|
* role 속성을 읽을 때 자동으로 배열로 변환해서 반환
|
||||||
*/
|
*/
|
||||||
public function __get(string $name)
|
public function __get(string $name): mixed
|
||||||
{
|
{
|
||||||
// role을 요청했고, 실제 데이터가 문자열로 존재한다면 배열로 변환
|
// role을 요청했고, 실제 데이터가 문자열로 존재한다면 배열로 변환
|
||||||
if ($name === 'role') {
|
switch ($name) {
|
||||||
if (is_string($this->role)) {
|
case 'role':
|
||||||
return explode(DEFAULTS["DELIMITER_ROLE"], $this->role);
|
$value = is_string($this->$name) ? explode(DEFAULTS["DELIMITER_ROLE"], $this->role) : [];
|
||||||
}
|
break;
|
||||||
return []; // null이거나 값이 없으면 빈 배열 반환
|
default:
|
||||||
}
|
|
||||||
|
|
||||||
// 부모에게 위임 (혹시 CommonDTO에도 __get이 있다면)
|
// 부모에게 위임 (혹시 CommonDTO에도 __get이 있다면)
|
||||||
// CommonDTO에 __get이 없다면 이 줄은 에러가 날 수 있으므로,
|
$value = parent::__get($name);
|
||||||
// 보통은 아래처럼 처리하거나 속성을 리턴해야 합니다.
|
break;
|
||||||
return $this->{$name} ?? null;
|
}
|
||||||
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// role 값을 설정할 때도 배열을 받을 수 있게 하려면 __set도 필요할 수 있습니다.
|
// role 값을 설정할 때도 배열을 받을 수 있게 하려면 __set도 필요할 수 있습니다.
|
||||||
// (선택 사항)
|
// (선택 사항)
|
||||||
public function setRole(array $roles)
|
public function setRole(array $roles): void
|
||||||
{
|
{
|
||||||
$this->role = implode(DEFAULTS["DELIMITER_ROLE"], $roles);
|
$this->role = implode(DEFAULTS["DELIMITER_ROLE"], $roles);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,9 +12,9 @@ class AccountDTO extends CommonDTO
|
|||||||
public ?string $bank = null;
|
public ?string $bank = null;
|
||||||
public ?string $title = null;
|
public ?string $title = null;
|
||||||
public ?string $alias = null;
|
public ?string $alias = null;
|
||||||
public ?string $email = null;
|
|
||||||
public ?string $issue_at = null;
|
public ?string $issue_at = null;
|
||||||
public ?int $amount = null;
|
public ?int $amount = null;
|
||||||
|
public ?int $balance = null;
|
||||||
public ?string $status = null;
|
public ?string $status = null;
|
||||||
public ?string $content = null;
|
public ?string $content = null;
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ class CouponDTO extends CommonDTO
|
|||||||
public ?int $clientinfo_uid = null;
|
public ?int $clientinfo_uid = null;
|
||||||
public ?string $title = null;
|
public ?string $title = null;
|
||||||
public ?int $amount = null;
|
public ?int $amount = null;
|
||||||
|
public ?int $balance = null;
|
||||||
public ?string $status = null;
|
public ?string $status = null;
|
||||||
public ?string $content = null;
|
public ?string $content = null;
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ class PointDTO extends CommonDTO
|
|||||||
public ?int $clientinfo_uid = null;
|
public ?int $clientinfo_uid = null;
|
||||||
public ?string $title = null;
|
public ?string $title = null;
|
||||||
public ?int $amount = null;
|
public ?int $amount = null;
|
||||||
|
public ?int $balance = null;
|
||||||
public ?string $status = null;
|
public ?string $status = null;
|
||||||
public ?string $content = null;
|
public ?string $content = null;
|
||||||
|
|
||||||
|
|||||||
@ -31,25 +31,24 @@ class UserDTO extends CommonDTO
|
|||||||
/**
|
/**
|
||||||
* role 속성을 읽을 때 자동으로 배열로 변환해서 반환
|
* role 속성을 읽을 때 자동으로 배열로 변환해서 반환
|
||||||
*/
|
*/
|
||||||
public function __get(string $name)
|
public function __get(string $name): mixed
|
||||||
{
|
{
|
||||||
// role을 요청했고, 실제 데이터가 문자열로 존재한다면 배열로 변환
|
// role을 요청했고, 실제 데이터가 문자열로 존재한다면 배열로 변환
|
||||||
if ($name === 'role') {
|
switch ($name) {
|
||||||
if (is_string($this->role)) {
|
case 'role':
|
||||||
return explode(DEFAULTS["DELIMITER_ROLE"], $this->role);
|
$value = is_string($this->name) ? explode(DEFAULTS["DELIMITER_ROLE"], $this->role) : [];
|
||||||
}
|
break;
|
||||||
return []; // null이거나 값이 없으면 빈 배열 반환
|
default:
|
||||||
}
|
|
||||||
|
|
||||||
// 부모에게 위임 (혹시 CommonDTO에도 __get이 있다면)
|
// 부모에게 위임 (혹시 CommonDTO에도 __get이 있다면)
|
||||||
// CommonDTO에 __get이 없다면 이 줄은 에러가 날 수 있으므로,
|
$value = parent::__get($name);
|
||||||
// 보통은 아래처럼 처리하거나 속성을 리턴해야 합니다.
|
break;
|
||||||
return $this->{$name} ?? null;
|
}
|
||||||
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// role 값을 설정할 때도 배열을 받을 수 있게 하려면 __set도 필요할 수 있습니다.
|
// role 값을 설정할 때도 배열을 받을 수 있게 하려면 __set도 필요할 수 있습니다.
|
||||||
// (선택 사항)
|
// (선택 사항)
|
||||||
public function setRole(array $roles)
|
public function setRole(array $roles): void
|
||||||
{
|
{
|
||||||
$this->role = implode(DEFAULTS["DELIMITER_ROLE"], $roles);
|
$this->role = implode(DEFAULTS["DELIMITER_ROLE"], $roles);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,7 +61,7 @@ class ClientEntity extends CustomerEntity
|
|||||||
return $decodedRole;
|
return $decodedRole;
|
||||||
}
|
}
|
||||||
// 2-b. JSON이 아니면 CSV로 가정하고 변환
|
// 2-b. JSON이 아니면 CSV로 가정하고 변환
|
||||||
$parts = explode(',', $role);
|
$parts = explode(DEFAULTS["DELIMITER_ROLE"], $role);
|
||||||
// 각 요소의 불필요한 공백과 따옴표 제거
|
// 각 요소의 불필요한 공백과 따옴표 제거
|
||||||
$cleanedRoles = array_map(fn($item) => trim($item, " \t\n\r\0\x0B\""), $parts);
|
$cleanedRoles = array_map(fn($item) => trim($item, " \t\n\r\0\x0B\""), $parts);
|
||||||
return array_filter($cleanedRoles);
|
return array_filter($cleanedRoles);
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class UserEntity extends CommonEntity
|
|||||||
return $decodedRole;
|
return $decodedRole;
|
||||||
}
|
}
|
||||||
// 2-b. JSON이 아니면 CSV로 가정하고 변환
|
// 2-b. JSON이 아니면 CSV로 가정하고 변환
|
||||||
$parts = explode(',', $role);
|
$parts = explode(DEFAULTS["DELIMITER_ROLE"], $role);
|
||||||
// 각 요소의 불필요한 공백과 따옴표 제거
|
// 각 요소의 불필요한 공백과 따옴표 제거
|
||||||
$cleanedRoles = array_map(fn($item) => trim($item, " \t\n\r\0\x0B\""), $parts);
|
$cleanedRoles = array_map(fn($item) => trim($item, " \t\n\r\0\x0B\""), $parts);
|
||||||
return array_filter($cleanedRoles);
|
return array_filter($cleanedRoles);
|
||||||
|
|||||||
@ -10,7 +10,21 @@ class GoogleForm extends CommonForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = ['access_code'];
|
||||||
|
$filters = [];
|
||||||
|
switch ($action) {
|
||||||
|
case 'login':
|
||||||
|
case 'login_form':
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters);
|
||||||
|
$this->setBatchjobFilters($filters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -10,7 +10,21 @@ class LocalForm extends CommonForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = ['id', 'passwd'];
|
||||||
|
$filters = [];
|
||||||
|
switch ($action) {
|
||||||
|
case 'login':
|
||||||
|
case 'login_form':
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters);
|
||||||
|
$this->setBatchjobFilters($filters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -10,18 +10,68 @@ class BoardForm extends CommonForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
// protected function getValidationRule(string $field, string $rule): array
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
// {
|
{
|
||||||
// switch ($field) {
|
$fields = [
|
||||||
// case 'role':
|
'category',
|
||||||
// $field = "{$field}.*";
|
'worker_uid',
|
||||||
// break;
|
'title',
|
||||||
// default:
|
'status',
|
||||||
// return parent::getValidationRule($field, $rule);
|
'content',
|
||||||
// // break;
|
];
|
||||||
// }
|
$filters = [
|
||||||
// return array($field, $rule);
|
'user_uid',
|
||||||
// }
|
'worker_uid',
|
||||||
|
'category',
|
||||||
|
'status',
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['user_uid', 'category', 'status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [
|
||||||
|
'category',
|
||||||
|
'worker_uid',
|
||||||
|
'title',
|
||||||
|
'status',
|
||||||
|
'created_at',
|
||||||
|
'content'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
$fields = [
|
||||||
|
'category',
|
||||||
|
'worker_uid',
|
||||||
|
'title',
|
||||||
|
'status',
|
||||||
|
'created_at'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
case 'download':
|
||||||
|
$fields = [
|
||||||
|
'category',
|
||||||
|
'worker_uid',
|
||||||
|
'title',
|
||||||
|
'status',
|
||||||
|
'created_at',
|
||||||
|
'content'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -20,6 +20,7 @@ abstract class CommonForm
|
|||||||
{
|
{
|
||||||
$this->_validation = service('validation');
|
$this->_validation = service('validation');
|
||||||
}
|
}
|
||||||
|
abstract public function action_init_process(string $action, array $formDatas = []): void;
|
||||||
final public function setAttributes(array $attributes): void
|
final public function setAttributes(array $attributes): void
|
||||||
{
|
{
|
||||||
$this->_attributes = $attributes;
|
$this->_attributes = $attributes;
|
||||||
|
|||||||
@ -8,6 +8,57 @@ class ClientForm extends CustomerForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
'site',
|
||||||
|
'name',
|
||||||
|
'email',
|
||||||
|
'phone',
|
||||||
|
'role',
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
'site',
|
||||||
|
'role',
|
||||||
|
'status',
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['site', 'role', 'status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [
|
||||||
|
'site',
|
||||||
|
'name',
|
||||||
|
'email',
|
||||||
|
'phone',
|
||||||
|
'role',
|
||||||
|
'account_balance',
|
||||||
|
'coupon_balance',
|
||||||
|
'point_balance',
|
||||||
|
'status',
|
||||||
|
'created_at',
|
||||||
|
'updated_at',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -8,6 +8,74 @@ class ServiceForm extends CustomerForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"site",
|
||||||
|
"location",
|
||||||
|
"clientinfo_uid",
|
||||||
|
'serverinfo_uid',
|
||||||
|
"rack",
|
||||||
|
"line",
|
||||||
|
"title",
|
||||||
|
"start_at",
|
||||||
|
"billing_at",
|
||||||
|
"status",
|
||||||
|
'sale',
|
||||||
|
"history",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
'site',
|
||||||
|
'location',
|
||||||
|
"rack",
|
||||||
|
"line",
|
||||||
|
'clientinfo_uid',
|
||||||
|
'serverinfo_uid',
|
||||||
|
'user_uid',
|
||||||
|
'status',
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = [
|
||||||
|
'site',
|
||||||
|
'location',
|
||||||
|
'clientinfo_uid',
|
||||||
|
'status'
|
||||||
|
];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [...$fields, 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [
|
||||||
|
'site',
|
||||||
|
'location',
|
||||||
|
'clientinfo_uid',
|
||||||
|
'serverinfo_uid',
|
||||||
|
'sale',
|
||||||
|
'amount',
|
||||||
|
'billing_at',
|
||||||
|
'status',
|
||||||
|
'start_at',
|
||||||
|
'created_at'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
case 'alternative_create_form':
|
||||||
|
$fields = ['serverinfo_uid'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -8,27 +8,70 @@ class AccountForm extends WalletForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"clientinfo_uid",
|
||||||
|
"bank",
|
||||||
|
"title",
|
||||||
|
"alias",
|
||||||
|
"issue_at",
|
||||||
|
"amount",
|
||||||
|
"status",
|
||||||
|
"content"
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"clientinfo_uid",
|
||||||
|
"bank",
|
||||||
|
"status",
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$actionButtons = ['view' => ICONS['SEARCH']];
|
||||||
|
$batchjobFilters = ['bank', 'status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [...$fields, 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [
|
||||||
|
"clientinfo_uid",
|
||||||
|
"bank",
|
||||||
|
"title",
|
||||||
|
"alias",
|
||||||
|
"issue_at",
|
||||||
|
"amount",
|
||||||
|
"status",
|
||||||
|
'created_at',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
|
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case "user_uid":
|
|
||||||
case "clientinfo_uid":
|
|
||||||
case "amount":
|
|
||||||
case "balance":
|
|
||||||
$rule = "required|numeric";
|
|
||||||
break;
|
|
||||||
case "bank":
|
case "bank":
|
||||||
case "title":
|
|
||||||
case "alias":
|
case "alias":
|
||||||
case "status":
|
|
||||||
$rule = "required|trim|string";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
case "issue_at":
|
case "issue_at":
|
||||||
$rule = "required|valid_date";
|
$rule = "required|valid_date";
|
||||||
break;
|
break;
|
||||||
case "content":
|
|
||||||
$rule = "permit_empty|trim|string";
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -8,24 +8,48 @@ class CouponForm extends WalletForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
{
|
{
|
||||||
switch ($field) {
|
$fields = [
|
||||||
case "clientinfo_uid":
|
"clientinfo_uid",
|
||||||
case "amount":
|
"title",
|
||||||
$rule = "required|numeric";
|
"amount",
|
||||||
|
"status",
|
||||||
|
"content",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"clientinfo_uid",
|
||||||
|
"status",
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$actionButtons = ['view' => ICONS['SEARCH']];
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
break;
|
break;
|
||||||
case "title":
|
case 'view':
|
||||||
case "status":
|
$fields = [...$fields, 'created_at'];
|
||||||
$rule = "required|trim|string";
|
|
||||||
break;
|
break;
|
||||||
case "content":
|
case 'index':
|
||||||
$rule = "permit_empty|trim|string";
|
case 'download':
|
||||||
break;
|
$fields = [
|
||||||
default:
|
"clientinfo_uid",
|
||||||
$rule = parent::getFormRule($action, $field);
|
"title",
|
||||||
|
"amount",
|
||||||
|
"status",
|
||||||
|
'created_at'
|
||||||
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,24 +8,48 @@ class PointForm extends WalletForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
{
|
{
|
||||||
switch ($field) {
|
$fields = [
|
||||||
case "clientinfo_uid":
|
"clientinfo_uid",
|
||||||
case "amount":
|
"title",
|
||||||
$rule = "required|numeric";
|
"amount",
|
||||||
|
"status",
|
||||||
|
"content",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"clientinfo_uid",
|
||||||
|
"status",
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$actionButtons = ['view' => ICONS['SEARCH']];
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
break;
|
break;
|
||||||
case "title":
|
case 'view':
|
||||||
case "status":
|
$fields = [...$fields, 'created_at'];
|
||||||
$rule = "required|trim|string";
|
|
||||||
break;
|
break;
|
||||||
case "content":
|
case 'index':
|
||||||
$rule = "permit_empty|trim|string";
|
case 'download':
|
||||||
break;
|
$fields = [
|
||||||
default:
|
"clientinfo_uid",
|
||||||
$rule = parent::getFormRule($action, $field);
|
"title",
|
||||||
|
"amount",
|
||||||
|
"status",
|
||||||
|
'created_at'
|
||||||
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,4 +10,26 @@ abstract class WalletForm extends CustomerForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function getFormRule(string $action, string $field): string
|
||||||
|
{
|
||||||
|
switch ($field) {
|
||||||
|
case "user_uid":
|
||||||
|
case "clientinfo_uid":
|
||||||
|
case "amount":
|
||||||
|
case "balance":
|
||||||
|
$rule = "required|numeric";
|
||||||
|
break;
|
||||||
|
case "title":
|
||||||
|
case "status":
|
||||||
|
$rule = "required|trim|string";
|
||||||
|
break;
|
||||||
|
case "content":
|
||||||
|
$rule = "permit_empty|trim|string";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$rule = parent::getFormRule($action, $field);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $rule;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,40 @@ class CHASSISForm extends EquipmentForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"title",
|
||||||
|
"price",
|
||||||
|
"stock",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"status",
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -8,6 +8,43 @@ class LineForm extends EquipmentForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"type",
|
||||||
|
"title",
|
||||||
|
"bandwith",
|
||||||
|
"start_at",
|
||||||
|
"end_at",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"type",
|
||||||
|
"status",
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -8,6 +8,66 @@ class ServerForm extends EquipmentForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"code",
|
||||||
|
"type",
|
||||||
|
"chassisinfo_uid",
|
||||||
|
"switchinfo_uid",
|
||||||
|
"ip",
|
||||||
|
"title",
|
||||||
|
"os",
|
||||||
|
"price",
|
||||||
|
"manufactur_at",
|
||||||
|
"format_at",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"clientinfo_uid",
|
||||||
|
'type',
|
||||||
|
"chassisinfo_uid",
|
||||||
|
'switchinfo_uid',
|
||||||
|
'ip',
|
||||||
|
'os',
|
||||||
|
"status",
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['type', 'switchinfo_uid', 'ip', 'os', 'status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = ['clientinfo_uid', ...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [
|
||||||
|
'clientinfo_uid',
|
||||||
|
"code",
|
||||||
|
"type",
|
||||||
|
"switchinfo_uid",
|
||||||
|
"ip",
|
||||||
|
"title",
|
||||||
|
"os",
|
||||||
|
"part",
|
||||||
|
"price",
|
||||||
|
"manufactur_at",
|
||||||
|
"format_at",
|
||||||
|
'status',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -10,6 +10,50 @@ class ServerPartForm extends EquipmentForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"serverinfo_uid",
|
||||||
|
"type",
|
||||||
|
"billing",
|
||||||
|
"part_uid",
|
||||||
|
"cnt",
|
||||||
|
"extra",
|
||||||
|
"amount",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"serverinfo_uid",
|
||||||
|
"type",
|
||||||
|
"part_uid",
|
||||||
|
"billing",
|
||||||
|
];
|
||||||
|
$indexFilter = [
|
||||||
|
"serverinfo_uid",
|
||||||
|
"type",
|
||||||
|
"billing",
|
||||||
|
];
|
||||||
|
$batchjobFilters = ['billing', 'type'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [...$fields, 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [...$fields, 'created_at'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -10,7 +10,33 @@ class MylogForm extends CommonForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = ['title', 'content'];
|
||||||
|
$filters = ['user_uid'];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = $filters;
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -8,6 +8,40 @@ class CPUForm extends PartForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"title",
|
||||||
|
"price",
|
||||||
|
"stock",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"status",
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -8,6 +8,67 @@ class CSForm extends PartForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"type",
|
||||||
|
"ip",
|
||||||
|
"accountid",
|
||||||
|
"domain",
|
||||||
|
"price",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"clientinfo_uid",
|
||||||
|
'serverinfo_uid',
|
||||||
|
'type',
|
||||||
|
'status'
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [
|
||||||
|
...$fields,
|
||||||
|
"clientinfo_uid",
|
||||||
|
'serverinfo_uid',
|
||||||
|
'type',
|
||||||
|
'ip',
|
||||||
|
'accountid',
|
||||||
|
'domain',
|
||||||
|
'price',
|
||||||
|
'status',
|
||||||
|
'created_at'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [
|
||||||
|
...$fields,
|
||||||
|
"clientinfo_uid",
|
||||||
|
'serverinfo_uid',
|
||||||
|
'type',
|
||||||
|
'ip',
|
||||||
|
'accountid',
|
||||||
|
'domain',
|
||||||
|
'price',
|
||||||
|
'status',
|
||||||
|
'created_at'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -8,6 +8,41 @@ class DISKForm extends PartForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"title",
|
||||||
|
"price",
|
||||||
|
"stock",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"status",
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, "format", 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [...$fields, "format", 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [...$fields, "format", 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -8,6 +8,58 @@ class IPForm extends PartForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"lineinfo_uid",
|
||||||
|
"ip",
|
||||||
|
"price",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
'old_clientinfo_uid',
|
||||||
|
'clientinfo_uid',
|
||||||
|
'serverinfo_uid',
|
||||||
|
"lineinfo_uid",
|
||||||
|
'status'
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [
|
||||||
|
...$fields,
|
||||||
|
'clientinfo_uid',
|
||||||
|
'serverinfo_uid',
|
||||||
|
'old_clientinfo_uid',
|
||||||
|
'status',
|
||||||
|
'created_at'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [
|
||||||
|
...$fields,
|
||||||
|
'clientinfo_uid',
|
||||||
|
'serverinfo_uid',
|
||||||
|
'old_clientinfo_uid',
|
||||||
|
'status',
|
||||||
|
'created_at'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -8,6 +8,40 @@ class RAMForm extends PartForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"title",
|
||||||
|
"price",
|
||||||
|
"stock",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"status",
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -8,6 +8,40 @@ class SOFTWAREForm extends PartForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"title",
|
||||||
|
"price",
|
||||||
|
"stock",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
"status",
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -8,6 +8,59 @@ class SWITCHForm extends PartForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"code",
|
||||||
|
"price",
|
||||||
|
];
|
||||||
|
$filters = [
|
||||||
|
'clientinfo_uid',
|
||||||
|
'serviceinfo_uid',
|
||||||
|
'serverinfo_uid',
|
||||||
|
'status'
|
||||||
|
];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['status',];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [
|
||||||
|
...$fields,
|
||||||
|
'status',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [
|
||||||
|
...$fields,
|
||||||
|
'clientinfo_uid',
|
||||||
|
'serviceinfo_uid',
|
||||||
|
'serverinfo_uid',
|
||||||
|
'status',
|
||||||
|
'created_at'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [
|
||||||
|
...$fields,
|
||||||
|
'clientinfo_uid',
|
||||||
|
'serviceinfo_uid',
|
||||||
|
'serverinfo_uid',
|
||||||
|
'status',
|
||||||
|
'created_at'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -10,6 +10,73 @@ class PaymentForm extends CommonForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
"serviceinfo_uid",
|
||||||
|
"title",
|
||||||
|
"amount",
|
||||||
|
"billing",
|
||||||
|
"billing_at",
|
||||||
|
"pay",
|
||||||
|
"status",
|
||||||
|
"content",
|
||||||
|
];
|
||||||
|
$filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
|
||||||
|
$indexFilter = ['clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
$actionButtons = ['paid' => '결제', 'view' => ICONS['SEARCH'], 'delete' => ICONS['DELETE']];
|
||||||
|
$batchjobButtons = ['batchjob' => '일괄결제', 'invoice' => '청구서발행'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = [
|
||||||
|
'clientinfo_uid',
|
||||||
|
"serviceinfo_uid",
|
||||||
|
'billing',
|
||||||
|
'title',
|
||||||
|
'amount',
|
||||||
|
'billing_at',
|
||||||
|
'pay',
|
||||||
|
'status',
|
||||||
|
'updated_at',
|
||||||
|
'countdown',
|
||||||
|
'user_uid',
|
||||||
|
'created_at',
|
||||||
|
'content'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = [
|
||||||
|
'clientinfo_uid',
|
||||||
|
"serviceinfo_uid",
|
||||||
|
'billing',
|
||||||
|
'title',
|
||||||
|
'amount',
|
||||||
|
'billing_at',
|
||||||
|
'pay',
|
||||||
|
'updated_at',
|
||||||
|
'countdown',
|
||||||
|
'user_uid',
|
||||||
|
'created_at'
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setActionButtons($actionButtons);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
$this->setBatchjobButtons($batchjobButtons);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -10,18 +10,43 @@ class UserForm extends CommonForm
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
// protected function getValidationRule(string $field, string $rule): array
|
public function action_init_process(string $action, array $formDatas = []): void
|
||||||
// {
|
{
|
||||||
// switch ($field) {
|
$fields = [
|
||||||
// case 'role':
|
'id',
|
||||||
// $field = "{$field}.*";
|
'passwd',
|
||||||
// break;
|
'confirmpassword',
|
||||||
// default:
|
'name',
|
||||||
// return parent::getValidationRule($field, $rule);
|
'email',
|
||||||
// // break;
|
'mobile',
|
||||||
// }
|
'role'
|
||||||
// return array($field, $rule);
|
];
|
||||||
// }
|
$filters = ['role', 'status'];
|
||||||
|
$indexFilter = $filters;
|
||||||
|
$batchjobFilters = ['status'];
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
case 'create_form':
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
case 'index':
|
||||||
|
case 'download':
|
||||||
|
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->setFormFields($fields);
|
||||||
|
$this->setFormRules($action, $fields);
|
||||||
|
$this->setFormFilters($filters);
|
||||||
|
$this->setFormOptions($action, $filters, $formDatas);
|
||||||
|
$this->setIndexFilters($indexFilter);
|
||||||
|
$this->setBatchjobFilters($batchjobFilters);
|
||||||
|
}
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -19,6 +19,7 @@ class CouponModel extends WalletModel
|
|||||||
"title",
|
"title",
|
||||||
"content",
|
"content",
|
||||||
"amount",
|
"amount",
|
||||||
|
"balance",
|
||||||
"status",
|
"status",
|
||||||
];
|
];
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
|||||||
@ -19,6 +19,7 @@ class PointModel extends WalletModel
|
|||||||
"title",
|
"title",
|
||||||
"content",
|
"content",
|
||||||
"amount",
|
"amount",
|
||||||
|
"balance",
|
||||||
"status",
|
"status",
|
||||||
];
|
];
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
|||||||
@ -8,7 +8,6 @@ use App\Forms\Auth\GoogleForm;
|
|||||||
use App\Libraries\MySocket\GoogleSocket\CURL;
|
use App\Libraries\MySocket\GoogleSocket\CURL;
|
||||||
use App\Models\UserModel;
|
use App\Models\UserModel;
|
||||||
use CodeIgniter\Exceptions\PageNotFoundException;
|
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||||
use CodeIgniter\Validation\Exceptions\ValidationException;
|
|
||||||
|
|
||||||
class GoogleService extends AuthService
|
class GoogleService extends AuthService
|
||||||
{
|
{
|
||||||
@ -40,21 +39,6 @@ class GoogleService extends AuthService
|
|||||||
}
|
}
|
||||||
return $this->_form;
|
return $this->_form;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = ['access_code'];
|
|
||||||
$filters = [];
|
|
||||||
switch ($action) {
|
|
||||||
case 'login':
|
|
||||||
case 'login_form':
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters);
|
|
||||||
$this->getFormService()->setBatchjobFilters($filters);
|
|
||||||
}
|
|
||||||
protected function getEntity_process(mixed $entity): UserEntity
|
protected function getEntity_process(mixed $entity): UserEntity
|
||||||
{
|
{
|
||||||
return $entity;
|
return $entity;
|
||||||
|
|||||||
@ -6,7 +6,6 @@ use App\DTOs\Auth\LocalDTO;
|
|||||||
use App\Entities\UserEntity;
|
use App\Entities\UserEntity;
|
||||||
use App\Forms\Auth\LocalForm;
|
use App\Forms\Auth\LocalForm;
|
||||||
use App\Models\UserModel;
|
use App\Models\UserModel;
|
||||||
use CodeIgniter\Validation\Exceptions\ValidationException;
|
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
|
||||||
class LocalService extends AuthService
|
class LocalService extends AuthService
|
||||||
@ -39,27 +38,13 @@ class LocalService extends AuthService
|
|||||||
}
|
}
|
||||||
return $this->_form;
|
return $this->_form;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = ['id', 'passwd'];
|
|
||||||
$filters = [];
|
|
||||||
switch ($action) {
|
|
||||||
case 'login':
|
|
||||||
case 'login_form':
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters);
|
|
||||||
$this->getFormService()->setBatchjobFilters($filters);
|
|
||||||
}
|
|
||||||
protected function getEntity_process(mixed $entity): UserEntity
|
protected function getEntity_process(mixed $entity): UserEntity
|
||||||
{
|
{
|
||||||
return $entity;
|
return $entity;
|
||||||
}
|
}
|
||||||
protected function login_process(array $formDatas): UserEntity
|
protected function login_process(array $formDatas): UserEntity
|
||||||
{
|
{
|
||||||
|
$this->getFormService()->action_init_process('login', $formDatas);
|
||||||
//입력값 검증
|
//입력값 검증
|
||||||
$this->getFormService()->validate($formDatas);
|
$this->getFormService()->validate($formDatas);
|
||||||
//로그인 정보확인
|
//로그인 정보확인
|
||||||
|
|||||||
@ -57,68 +57,6 @@ class BoardService extends CommonService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
'category',
|
|
||||||
'worker_uid',
|
|
||||||
'title',
|
|
||||||
'status',
|
|
||||||
'content',
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
'user_uid',
|
|
||||||
'worker_uid',
|
|
||||||
'category',
|
|
||||||
'status',
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['user_uid', 'category', 'status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
break;
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [
|
|
||||||
'category',
|
|
||||||
'worker_uid',
|
|
||||||
'title',
|
|
||||||
'status',
|
|
||||||
'created_at',
|
|
||||||
'content'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
$fields = [
|
|
||||||
'category',
|
|
||||||
'worker_uid',
|
|
||||||
'title',
|
|
||||||
'status',
|
|
||||||
'created_at'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
case 'download':
|
|
||||||
$fields = [
|
|
||||||
'category',
|
|
||||||
'worker_uid',
|
|
||||||
'title',
|
|
||||||
'status',
|
|
||||||
'created_at',
|
|
||||||
'content'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): BoardEntity
|
protected function getEntity_process(mixed $entity): BoardEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -19,7 +19,6 @@ abstract class CommonService
|
|||||||
private array $_classPaths = [];
|
private array $_classPaths = [];
|
||||||
protected $title = null;
|
protected $title = null;
|
||||||
protected function __construct(protected CommonModel $model) {}
|
protected function __construct(protected CommonModel $model) {}
|
||||||
abstract public function action_init_process(string $action, array $formDatas = []): void;
|
|
||||||
abstract public function getDTOClass(): string;
|
abstract public function getDTOClass(): string;
|
||||||
abstract public function createDTO(array $formDatas): CommonDTO;
|
abstract public function createDTO(array $formDatas): CommonDTO;
|
||||||
abstract public function getEntityClass(): string;
|
abstract public function getEntityClass(): string;
|
||||||
@ -177,15 +176,20 @@ abstract class CommonService
|
|||||||
//생성용
|
//생성용
|
||||||
protected function create_process(array $formDatas): CommonEntity
|
protected function create_process(array $formDatas): CommonEntity
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
|
$this->getFormService()->action_init_process('create', $formDatas);
|
||||||
// 데이터 검증
|
// 데이터 검증
|
||||||
$this->getFormService()->validate($formDatas);
|
$this->getFormService()->validate($formDatas);
|
||||||
// 💡 동적으로 가져온 Entity 클래스 이름으로 instanceof 검사
|
// 💡 동적으로 가져온 Entity 클래스 이름으로 instanceof 검사
|
||||||
$entityClass = $this->getEntityClass();
|
$entityClass = $this->getEntityClass();
|
||||||
$entity = new $entityClass($formDatas);
|
$entity = new $entityClass($formDatas);
|
||||||
if (!$entity instanceof $entityClass) {
|
if (!$entity instanceof $entityClass) {
|
||||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:Return Type은 {$entityClass}만 가능");
|
throw new RuntimeException("Return Type은 {$entityClass}만 가능");
|
||||||
}
|
}
|
||||||
return $this->save_process($entity);
|
return $this->save_process($entity);
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:" . $e->getMessage() . var_export($entity));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
final public function create(array $formDatas): CommonEntity
|
final public function create(array $formDatas): CommonEntity
|
||||||
{
|
{
|
||||||
@ -215,16 +219,20 @@ abstract class CommonService
|
|||||||
//수정용
|
//수정용
|
||||||
protected function modify_process($entity, array $formDatas): CommonEntity
|
protected function modify_process($entity, array $formDatas): CommonEntity
|
||||||
{
|
{
|
||||||
$fields = array_keys($formDatas);
|
try {
|
||||||
$this->getFormService()->setFormFields($fields);
|
$this->getFormService()->action_init_process('modify', $formDatas);
|
||||||
$this->getFormService()->setFormRules('modify', $fields);
|
// 2. 사용자 입력값(formDatas)을 Entity에 주입
|
||||||
// 데이터 검증
|
// fill()을 사용하면 Entity 내부에서 어떤 값이 변경되었는지(Dirty) 추적 시작
|
||||||
$this->getFormService()->validate($formDatas);
|
|
||||||
// 2. 폼 데이터를 엔티티에 병합합니다. (fill() 사용)
|
|
||||||
$entity->fill($formDatas);
|
$entity->fill($formDatas);
|
||||||
// var_dump($formDatas);
|
if (!$entity->hasChanged()) {
|
||||||
// dd($entity);
|
return $entity;
|
||||||
|
}
|
||||||
|
// 데이터 검증
|
||||||
|
$this->getFormService()->validate($entity->toArray());
|
||||||
return $this->save_process($entity);
|
return $this->save_process($entity);
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:" . $e->getMessage() . "\n" . var_export($entity));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function modify(string|int $uid, array $formDatas): CommonEntity
|
final public function modify(string|int $uid, array $formDatas): CommonEntity
|
||||||
|
|||||||
@ -59,57 +59,6 @@ class ClientService extends CustomerService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
'site',
|
|
||||||
'name',
|
|
||||||
'email',
|
|
||||||
'phone',
|
|
||||||
'role',
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
'site',
|
|
||||||
'role',
|
|
||||||
'status',
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['site', 'role', 'status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
break;
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [
|
|
||||||
'site',
|
|
||||||
'name',
|
|
||||||
'email',
|
|
||||||
'phone',
|
|
||||||
'role',
|
|
||||||
'account_balance',
|
|
||||||
'coupon_balance',
|
|
||||||
'point_balance',
|
|
||||||
'status',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): ClientEntity
|
protected function getEntity_process(mixed $entity): ClientEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -60,74 +60,6 @@ class ServiceService extends CustomerService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"site",
|
|
||||||
"location",
|
|
||||||
"clientinfo_uid",
|
|
||||||
'serverinfo_uid',
|
|
||||||
"rack",
|
|
||||||
"line",
|
|
||||||
"title",
|
|
||||||
"start_at",
|
|
||||||
"billing_at",
|
|
||||||
"status",
|
|
||||||
'sale',
|
|
||||||
"history",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
'site',
|
|
||||||
'location',
|
|
||||||
"rack",
|
|
||||||
"line",
|
|
||||||
'clientinfo_uid',
|
|
||||||
'serverinfo_uid',
|
|
||||||
'user_uid',
|
|
||||||
'status',
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = [
|
|
||||||
'site',
|
|
||||||
'location',
|
|
||||||
'clientinfo_uid',
|
|
||||||
'status'
|
|
||||||
];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [
|
|
||||||
'site',
|
|
||||||
'location',
|
|
||||||
'clientinfo_uid',
|
|
||||||
'serverinfo_uid',
|
|
||||||
'sale',
|
|
||||||
'amount',
|
|
||||||
'billing_at',
|
|
||||||
'status',
|
|
||||||
'start_at',
|
|
||||||
'created_at'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
case 'alternative_create_form':
|
|
||||||
$fields = ['serverinfo_uid'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//추가 기능
|
//추가 기능
|
||||||
//interval을 기준으로 최근 신규 서비스정보 가져오기
|
//interval을 기준으로 최근 신규 서비스정보 가져오기
|
||||||
final public function getNewServiceEntities(int $interval, string $status = STATUS['AVAILABLE']): array
|
final public function getNewServiceEntities(int $interval, string $status = STATUS['AVAILABLE']): array
|
||||||
@ -173,12 +105,21 @@ class ServiceService extends CustomerService
|
|||||||
return $date->format('Y-m-d');
|
return $date->format('Y-m-d');
|
||||||
}
|
}
|
||||||
// 서비스금액관련처리
|
// 서비스금액관련처리
|
||||||
final public function updateAmount(ServiceEntity $entity): ServiceEntity
|
private function getCalculatedAmount(int $rack_price, int $line_price, int $sale_price, $serverinfo_uid): int
|
||||||
{
|
{
|
||||||
//총 서비스금액 구하기
|
//총 서비스금액 구하기
|
||||||
$server_amount = service('equipment_serverservice')->getCalculatedAmount($entity->getServerInfoUID());
|
$server_amount = service('equipment_serverservice')->getCalculatedAmount($serverinfo_uid);
|
||||||
|
return (int)$server_amount + $rack_price + $line_price - $sale_price;
|
||||||
|
}
|
||||||
|
final public function updateAmount(ServiceEntity $entity): ServiceEntity
|
||||||
|
{
|
||||||
//기본:서버금액(서버비+서버파트(월비용))+상면비+회선비-할인액
|
//기본:서버금액(서버비+서버파트(월비용))+상면비+회선비-할인액
|
||||||
$entity->amount = (int)$server_amount + $entity->getRack() + $entity->getLine() - $entity->getSale();
|
$entity->amount = $this->getCalculatedAmount(
|
||||||
|
$entity->getRack(),
|
||||||
|
$entity->getLine(),
|
||||||
|
$entity->getSale(),
|
||||||
|
$entity->getServerInfoUID()
|
||||||
|
);
|
||||||
//총 서비스금액 설정 및 저장
|
//총 서비스금액 설정 및 저장
|
||||||
if (!$this->model->save($entity)) {
|
if (!$this->model->save($entity)) {
|
||||||
// 저장 실패 시 예외 처리
|
// 저장 실패 시 예외 처리
|
||||||
@ -211,6 +152,8 @@ class ServiceService extends CustomerService
|
|||||||
{
|
{
|
||||||
//생성폼에는 없는 필수항목 지정용(code)
|
//생성폼에는 없는 필수항목 지정용(code)
|
||||||
$formDatas['code'] = $formDatas['site'] . "_s" . uniqid();
|
$formDatas['code'] = $formDatas['site'] . "_s" . uniqid();
|
||||||
|
//총서비스금액
|
||||||
|
$formDatas['amount'] = $this->getCalculatedAmount($formDatas['rack'], $formDatas['line'], $formDatas['sale'], $formDatas['serverinfo_uid']);
|
||||||
//서비스 생성
|
//서비스 생성
|
||||||
$entity = parent::create_process($formDatas);
|
$entity = parent::create_process($formDatas);
|
||||||
if (!$entity instanceof ServiceEntity) {
|
if (!$entity instanceof ServiceEntity) {
|
||||||
|
|||||||
@ -61,59 +61,6 @@ class AccountService extends WalletService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"bank",
|
|
||||||
"title",
|
|
||||||
"alias",
|
|
||||||
"issue_at",
|
|
||||||
"amount",
|
|
||||||
"status",
|
|
||||||
"content"
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"bank",
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$actionButtons = ['view' => ICONS['SEARCH']];
|
|
||||||
$batchjobFilters = ['bank', 'status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
break;
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"bank",
|
|
||||||
"title",
|
|
||||||
"alias",
|
|
||||||
"issue_at",
|
|
||||||
"amount",
|
|
||||||
"status",
|
|
||||||
'created_at',
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setActionButtons($actionButtons);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): AccountEntity
|
protected function getEntity_process(mixed $entity): AccountEntity
|
||||||
{
|
{
|
||||||
@ -143,12 +90,13 @@ class AccountService extends WalletService
|
|||||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 잔액이 0보다 값이 정의 되었습니다.");
|
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 잔액이 0보다 값이 정의 되었습니다.");
|
||||||
}
|
}
|
||||||
//고객 잔액 갱신
|
//고객 잔액 갱신
|
||||||
service('customer_clientservice')->modify_process($clientEntity, [self::CLIENTINFO_BALANCE_FIELD => $formDatas['balance']]);
|
service('customer_clientservice')->modify($clientEntity->getPK(), [self::CLIENTINFO_BALANCE_FIELD => $formDatas['balance']]);
|
||||||
return parent::deposit_process($clientEntity, $formDatas);
|
return parent::deposit_process($clientEntity, $formDatas);
|
||||||
}
|
}
|
||||||
//결제 관련 출금 처리
|
//결제 관련 출금 처리
|
||||||
protected function withdrawal_process(ClientEntity $clientEntity, array $formDatas): array
|
protected function withdrawal_process(ClientEntity $clientEntity, array $formDatas): array
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
if (!array_key_exists('amount', $formDatas)) {
|
if (!array_key_exists('amount', $formDatas)) {
|
||||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 출금액이 정의되지 않았습니다.");
|
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 출금액이 정의되지 않았습니다.");
|
||||||
}
|
}
|
||||||
@ -168,8 +116,11 @@ class AccountService extends WalletService
|
|||||||
if ($formDatas['balance'] < 0) {
|
if ($formDatas['balance'] < 0) {
|
||||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 잔액({$formDatas['balance']})이 0보다 작은 값이 정의되었습니다.");
|
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 잔액({$formDatas['balance']})이 0보다 작은 값이 정의되었습니다.");
|
||||||
}
|
}
|
||||||
//고객 잔액 갱신
|
//고객의 Account Balance수정
|
||||||
service('customer_clientservice')->modify_process($clientEntity, [self::CLIENTINFO_BALANCE_FIELD => $formDatas['balance']]);
|
service('customer_clientservice')->modify($clientEntity->getPK(), [self::CLIENTINFO_BALANCE_FIELD => $formDatas['balance']]);
|
||||||
return parent::withdrawal_process($clientEntity, $formDatas);
|
return parent::withdrawal_process($clientEntity, $formDatas);
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:" . $e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,50 +61,6 @@ class CouponService extends WalletService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"title",
|
|
||||||
"amount",
|
|
||||||
"status",
|
|
||||||
"content",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$actionButtons = ['view' => ICONS['SEARCH']];
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"title",
|
|
||||||
"amount",
|
|
||||||
"status",
|
|
||||||
'created_at'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setActionButtons($actionButtons);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): CouponEntity
|
protected function getEntity_process(mixed $entity): CouponEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -61,50 +61,6 @@ class PointService extends WalletService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"title",
|
|
||||||
"amount",
|
|
||||||
"status",
|
|
||||||
"content",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$actionButtons = ['view' => ICONS['SEARCH']];
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"title",
|
|
||||||
"amount",
|
|
||||||
"status",
|
|
||||||
'created_at'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setActionButtons($actionButtons);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): PointEntity
|
protected function getEntity_process(mixed $entity): PointEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -73,8 +73,6 @@ abstract class WalletService extends CustomerService
|
|||||||
'amount' => $paymentEntity->getAmount(),
|
'amount' => $paymentEntity->getAmount(),
|
||||||
'status' => STATUS['WITHDRAWAL'],
|
'status' => STATUS['WITHDRAWAL'],
|
||||||
];
|
];
|
||||||
//초기화
|
|
||||||
$this->action_init_process('create');
|
|
||||||
$this->create_process($formDatas);
|
$this->create_process($formDatas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,40 +60,6 @@ class CHASSISService extends EquipmentService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"title",
|
|
||||||
"price",
|
|
||||||
"stock",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): CHASSISEntity
|
protected function getEntity_process(mixed $entity): CHASSISEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -59,43 +59,6 @@ class LineService extends EquipmentService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"type",
|
|
||||||
"title",
|
|
||||||
"bandwith",
|
|
||||||
"start_at",
|
|
||||||
"end_at",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"type",
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): LineEntity
|
protected function getEntity_process(mixed $entity): LineEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -63,50 +63,6 @@ class ServerPartService extends EquipmentService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"serverinfo_uid",
|
|
||||||
"type",
|
|
||||||
"billing",
|
|
||||||
"part_uid",
|
|
||||||
"cnt",
|
|
||||||
"extra",
|
|
||||||
"amount",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"serverinfo_uid",
|
|
||||||
"type",
|
|
||||||
"part_uid",
|
|
||||||
"billing",
|
|
||||||
];
|
|
||||||
$indexFilter = [
|
|
||||||
"serverinfo_uid",
|
|
||||||
"type",
|
|
||||||
"billing",
|
|
||||||
];
|
|
||||||
$batchjobFilters = ['billing', 'type'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [...$fields, 'created_at'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//각 파트별 서비스
|
//각 파트별 서비스
|
||||||
private function getPartService(string $type): PartService
|
private function getPartService(string $type): PartService
|
||||||
{
|
{
|
||||||
|
|||||||
@ -60,66 +60,6 @@ class ServerService extends EquipmentService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"code",
|
|
||||||
"type",
|
|
||||||
"chassisinfo_uid",
|
|
||||||
"switchinfo_uid",
|
|
||||||
"ip",
|
|
||||||
"title",
|
|
||||||
"os",
|
|
||||||
"price",
|
|
||||||
"manufactur_at",
|
|
||||||
"format_at",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"clientinfo_uid",
|
|
||||||
'type',
|
|
||||||
"chassisinfo_uid",
|
|
||||||
'switchinfo_uid',
|
|
||||||
'ip',
|
|
||||||
'os',
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['type', 'switchinfo_uid', 'ip', 'os', 'status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = ['clientinfo_uid', ...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [
|
|
||||||
'clientinfo_uid',
|
|
||||||
"code",
|
|
||||||
"type",
|
|
||||||
"switchinfo_uid",
|
|
||||||
"ip",
|
|
||||||
"title",
|
|
||||||
"os",
|
|
||||||
"part",
|
|
||||||
"price",
|
|
||||||
"manufactur_at",
|
|
||||||
"format_at",
|
|
||||||
'status',
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
final public function getTotalServiceCount(array $where = []): array
|
final public function getTotalServiceCount(array $where = []): array
|
||||||
{
|
{
|
||||||
$totalCounts = [
|
$totalCounts = [
|
||||||
|
|||||||
@ -45,33 +45,6 @@ class MylogService extends CommonService implements PipelineStepInterface
|
|||||||
}
|
}
|
||||||
return $this->_form;
|
return $this->_form;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = ['title', 'content'];
|
|
||||||
$filters = ['user_uid'];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = $filters;
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
public function getHelper(): MylogHelper
|
public function getHelper(): MylogHelper
|
||||||
{
|
{
|
||||||
if ($this->_helper === null) {
|
if ($this->_helper === null) {
|
||||||
|
|||||||
@ -59,40 +59,6 @@ class CPUService extends PartType1Service
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"title",
|
|
||||||
"price",
|
|
||||||
"stock",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): CPUEntity
|
protected function getEntity_process(mixed $entity): CPUEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -60,67 +60,6 @@ class CSService extends PartType2Service
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"type",
|
|
||||||
"ip",
|
|
||||||
"accountid",
|
|
||||||
"domain",
|
|
||||||
"price",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"clientinfo_uid",
|
|
||||||
'serverinfo_uid',
|
|
||||||
'type',
|
|
||||||
'status'
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [
|
|
||||||
...$fields,
|
|
||||||
"clientinfo_uid",
|
|
||||||
'serverinfo_uid',
|
|
||||||
'type',
|
|
||||||
'ip',
|
|
||||||
'accountid',
|
|
||||||
'domain',
|
|
||||||
'price',
|
|
||||||
'status',
|
|
||||||
'created_at'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [
|
|
||||||
...$fields,
|
|
||||||
"clientinfo_uid",
|
|
||||||
'serverinfo_uid',
|
|
||||||
'type',
|
|
||||||
'ip',
|
|
||||||
'accountid',
|
|
||||||
'domain',
|
|
||||||
'price',
|
|
||||||
'status',
|
|
||||||
'created_at'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): CSEntity
|
protected function getEntity_process(mixed $entity): CSEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -60,42 +60,6 @@ class DISKService extends PartType1Service
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"title",
|
|
||||||
"price",
|
|
||||||
"stock",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
break;
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, "format", 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, "format", 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [...$fields, "format", 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): DISKEntity
|
protected function getEntity_process(mixed $entity): DISKEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -60,58 +60,6 @@ class IPService extends PartType3Service
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"lineinfo_uid",
|
|
||||||
"ip",
|
|
||||||
"price",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
'old_clientinfo_uid',
|
|
||||||
'clientinfo_uid',
|
|
||||||
'serverinfo_uid',
|
|
||||||
"lineinfo_uid",
|
|
||||||
'status'
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [
|
|
||||||
...$fields,
|
|
||||||
'clientinfo_uid',
|
|
||||||
'serverinfo_uid',
|
|
||||||
'old_clientinfo_uid',
|
|
||||||
'status',
|
|
||||||
'created_at'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [
|
|
||||||
...$fields,
|
|
||||||
'clientinfo_uid',
|
|
||||||
'serverinfo_uid',
|
|
||||||
'old_clientinfo_uid',
|
|
||||||
'status',
|
|
||||||
'created_at'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): IPEntity
|
protected function getEntity_process(mixed $entity): IPEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -8,7 +8,6 @@ use App\Helpers\Part\RAMHelper;
|
|||||||
use App\Forms\Part\RAMForm;
|
use App\Forms\Part\RAMForm;
|
||||||
use App\Entities\Part\RAMEntity;
|
use App\Entities\Part\RAMEntity;
|
||||||
use App\Entities\Equipment\ServerPartEntity;
|
use App\Entities\Equipment\ServerPartEntity;
|
||||||
use App\Entities\CommonEntity;
|
|
||||||
use App\DTOs\Part\RAMDTO;
|
use App\DTOs\Part\RAMDTO;
|
||||||
|
|
||||||
class RAMService extends PartType1Service
|
class RAMService extends PartType1Service
|
||||||
@ -60,40 +59,6 @@ class RAMService extends PartType1Service
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"title",
|
|
||||||
"price",
|
|
||||||
"stock",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): RAMEntity
|
protected function getEntity_process(mixed $entity): RAMEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -46,40 +46,6 @@ class SOFTWAREService extends PartType1Service
|
|||||||
}
|
}
|
||||||
return $this->_form;
|
return $this->_form;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"title",
|
|
||||||
"price",
|
|
||||||
"stock",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [...$fields, 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
public function getHelper(): SOFTWAREHelper
|
public function getHelper(): SOFTWAREHelper
|
||||||
{
|
{
|
||||||
if ($this->_helper === null) {
|
if ($this->_helper === null) {
|
||||||
|
|||||||
@ -61,59 +61,6 @@ class SWITCHService extends PartType3Service
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"code",
|
|
||||||
"price",
|
|
||||||
];
|
|
||||||
$filters = [
|
|
||||||
'clientinfo_uid',
|
|
||||||
'serviceinfo_uid',
|
|
||||||
'serverinfo_uid',
|
|
||||||
'status'
|
|
||||||
];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['status',];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [
|
|
||||||
...$fields,
|
|
||||||
'status',
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [
|
|
||||||
...$fields,
|
|
||||||
'clientinfo_uid',
|
|
||||||
'serviceinfo_uid',
|
|
||||||
'serverinfo_uid',
|
|
||||||
'status',
|
|
||||||
'created_at'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [
|
|
||||||
...$fields,
|
|
||||||
'clientinfo_uid',
|
|
||||||
'serviceinfo_uid',
|
|
||||||
'serverinfo_uid',
|
|
||||||
'status',
|
|
||||||
'created_at'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): SWITCHEntity
|
protected function getEntity_process(mixed $entity): SWITCHEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -65,73 +65,6 @@ class PaymentService extends CommonService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
"serviceinfo_uid",
|
|
||||||
"title",
|
|
||||||
"amount",
|
|
||||||
"billing",
|
|
||||||
"billing_at",
|
|
||||||
"pay",
|
|
||||||
"status",
|
|
||||||
"content",
|
|
||||||
];
|
|
||||||
$filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
|
|
||||||
$indexFilter = ['clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
$actionButtons = ['paid' => '결제', 'view' => ICONS['SEARCH'], 'delete' => ICONS['DELETE']];
|
|
||||||
$batchjobButtons = ['batchjob' => '일괄결제', 'invoice' => '청구서발행'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
break;
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = [
|
|
||||||
'clientinfo_uid',
|
|
||||||
"serviceinfo_uid",
|
|
||||||
'billing',
|
|
||||||
'title',
|
|
||||||
'amount',
|
|
||||||
'billing_at',
|
|
||||||
'pay',
|
|
||||||
'status',
|
|
||||||
'updated_at',
|
|
||||||
'countdown',
|
|
||||||
'user_uid',
|
|
||||||
'created_at',
|
|
||||||
'content'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = [
|
|
||||||
'clientinfo_uid',
|
|
||||||
"serviceinfo_uid",
|
|
||||||
'billing',
|
|
||||||
'title',
|
|
||||||
'amount',
|
|
||||||
'billing_at',
|
|
||||||
'pay',
|
|
||||||
'updated_at',
|
|
||||||
'countdown',
|
|
||||||
'user_uid',
|
|
||||||
'created_at'
|
|
||||||
];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setActionButtons($actionButtons);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
$this->getFormService()->setBatchjobButtons($batchjobButtons);
|
|
||||||
}
|
|
||||||
//총 미납건수, 금액
|
//총 미납건수, 금액
|
||||||
final public function getUnPaids(string $group, array $where = []): array
|
final public function getUnPaids(string $group, array $where = []): array
|
||||||
{
|
{
|
||||||
@ -357,7 +290,6 @@ class PaymentService extends CommonService
|
|||||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 서비스정보가 정의되지 않아 일회성 상품을 설정하실수 없습니다.");
|
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 서비스정보가 정의되지 않아 일회성 상품을 설정하실수 없습니다.");
|
||||||
}
|
}
|
||||||
$formDatas = $this->getFormDatasFromServerPart($serverPartEntity);
|
$formDatas = $this->getFormDatasFromServerPart($serverPartEntity);
|
||||||
$this->action_init_process('create', $formDatas);
|
|
||||||
return parent::create_process($formDatas);
|
return parent::create_process($formDatas);
|
||||||
}
|
}
|
||||||
public function modifyByServerPart(ServerPartEntity $oldServerPartEntity, ServerPartEntity $serverPartEntity): PaymentEntity
|
public function modifyByServerPart(ServerPartEntity $oldServerPartEntity, ServerPartEntity $serverPartEntity): PaymentEntity
|
||||||
|
|||||||
@ -59,43 +59,6 @@ class UserService extends CommonService
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
public function action_init_process(string $action, array $formDatas = []): void
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
'id',
|
|
||||||
'passwd',
|
|
||||||
'confirmpassword',
|
|
||||||
'name',
|
|
||||||
'email',
|
|
||||||
'mobile',
|
|
||||||
'role'
|
|
||||||
];
|
|
||||||
$filters = ['role', 'status'];
|
|
||||||
$indexFilter = $filters;
|
|
||||||
$batchjobFilters = ['status'];
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'create_form':
|
|
||||||
break;
|
|
||||||
case 'modify':
|
|
||||||
case 'modify_form':
|
|
||||||
$fields = [...$fields, 'status'];
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
case 'index':
|
|
||||||
case 'download':
|
|
||||||
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->getFormService()->setFormFields($fields);
|
|
||||||
$this->getFormService()->setFormRules($action, $fields);
|
|
||||||
$this->getFormService()->setFormFilters($filters);
|
|
||||||
$this->getFormService()->setFormOptions($action, $filters, $formDatas);
|
|
||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): UserEntity
|
protected function getEntity_process(mixed $entity): UserEntity
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user