diff --git a/app/Cells/Equipment/ServerCell.php b/app/Cells/Equipment/ServerCell.php
index e839906..83ed3a2 100644
--- a/app/Cells/Equipment/ServerCell.php
+++ b/app/Cells/Equipment/ServerCell.php
@@ -9,7 +9,7 @@ class ServerCell extends EquipmentCell
public function __construct()
{
- parent::__construct(new ServerService());
+ parent::__construct(service('equipment_serverservice'));
}
//서비스 방식에 따른 서비스별 Count
@@ -52,24 +52,15 @@ class ServerCell extends EquipmentCell
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
return view('cells/server/' . $template, [
'serviceCellDatas' => [
- 'control' => $this->getService()->getControlDatas(),
- 'service' => $this->getService(),
'totalCounts' => $totalCounts,
]
]);
}
public function stock(array $params): string
{
- $this->getService()->setAction(__FUNCTION__);
- $this->getService()->setFormFields();
- $this->getService()->setFormFilters();
- $this->getService()->setFormRules();
- $this->getService()->setFormOptions();
$template = array_key_exists('template', $params) ? $params['template'] : 'stock';
return view('cells/server/' . $template, [
'partCellDatas' => [
- 'control' => $this->getService()->getControlDatas(),
- 'service' => $this->getService(),
'rows' => $this->getService()->getStockCount(),
],
]);
diff --git a/app/Cells/MylogCell.php b/app/Cells/MylogCell.php
index 285bc34..516be9b 100644
--- a/app/Cells/MylogCell.php
+++ b/app/Cells/MylogCell.php
@@ -10,22 +10,19 @@ class MylogCell extends CommonCell
public function __construct()
{
- parent::__construct(new MyLogService());
+ parent::__construct(service('mylogservice'));
}
public function dashboard(array $params): string
{
- $this->getService()->setAction(__FUNCTION__);
- $this->getService()->setFormFields();
- $this->getService()->setFormFilters();
- $this->getService()->setFormRules();
- $this->getService()->setFormOptions();
+ $this->getService()->action_init_process(__FUNCTION__);
$this->getService()->setLimit(20);
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
return view('cells/mylog/' . $template, [
'myLogCellDatas' => [
- 'service' => $this->getService(),
- 'control' => $this->getService()->getControlDatas(),
+ 'helper' => $this->getService()->getHelper(),
+ 'formFilters' => $this->getService()->getFormService()->getFormFilters(),
+ 'formOptions' => $this->getService()->getFormService()->getFormOptions(),
'entities' => $this->getService()->getEntities(),
]
]);
diff --git a/app/Cells/Part/DISKCell.php b/app/Cells/Part/DISKCell.php
index d2fa0b8..019086f 100644
--- a/app/Cells/Part/DISKCell.php
+++ b/app/Cells/Part/DISKCell.php
@@ -8,21 +8,18 @@ class DISKCell extends PartCell
{
public function __construct()
{
- parent::__construct(new DISKService());
+ parent::__construct(service('part_diskservice'));
}
public function stock(array $params): string
{
- $this->getService()->setAction(__FUNCTION__);
- $this->getService()->setFormFields();
- $this->getService()->setFormFilters();
- $this->getService()->setFormRules();
- $this->getService()->setFormOptions();
+ $this->getService()->action_init_process(__FUNCTION__);
$template = array_key_exists('template', $params) ? $params['template'] : 'disk_stock';
return view('cells/part/' . $template, [
'partCellDatas' => [
- 'control' => $this->getService()->getControlDatas(),
- 'service' => $this->getService(),
+ 'helper' => $this->getService()->getHelper(),
+ 'formFilters' => $this->getService()->getFormService()->getFormFilters(),
+ 'formOptions' => $this->getService()->getFormService()->getFormOptions(),
'entities' => $this->getService()->getEntities(),
],
]);
diff --git a/app/Cells/Part/RAMCell.php b/app/Cells/Part/RAMCell.php
index b1e134e..276b018 100644
--- a/app/Cells/Part/RAMCell.php
+++ b/app/Cells/Part/RAMCell.php
@@ -8,21 +8,14 @@ class RAMCell extends PartCell
{
public function __construct()
{
- parent::__construct(new RAMService());
+ parent::__construct(service('part_ramservice'));
}
public function stock(array $params): string
{
- $this->getService()->setAction(__FUNCTION__);
- $this->getService()->setFormFields();
- $this->getService()->setFormFilters();
- $this->getService()->setFormRules();
- $this->getService()->setFormOptions();
$template = array_key_exists('template', $params) ? $params['template'] : 'ram_stock';
return view('cells/part/' . $template, [
'partCellDatas' => [
- 'control' => $this->getService()->getControlDatas(),
- 'service' => $this->getService(),
'entities' => $this->getService()->getEntities(),
],
]);
diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index 5e72e70..aa9a5cc 100644
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -68,8 +68,7 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob', 'BoardController::batchjob');
$routes->post('batchjob_delete', 'BoardController::batchjob_delete');
$routes->get('download/(:alpha)', 'BoardController::download/$1');
- $routes->get('notice', 'BoardController::notice');
- $routes->get('reqeusttask', 'BoardController::reqeusttask');
+ $routes->get('latest/(:alpha)', 'BoardController::latest/$1');
});
$routes->group('payment', function ($routes) {
$routes->get('/', 'PaymentController::index');
diff --git a/app/Controllers/Admin/AdminController.php b/app/Controllers/Admin/AdminController.php
index b7283c3..7f85482 100644
--- a/app/Controllers/Admin/AdminController.php
+++ b/app/Controllers/Admin/AdminController.php
@@ -20,8 +20,10 @@ abstract class AdminController extends CommonController
}
protected function action_init_process(string $action): void
{
+ $this->service->action_init_process($action);
parent::action_init_process($action);
$this->addViewDatas('layout', $this->getLayout());
+ $this->addViewDatas('title', $this->getTitle());
$this->addViewDatas('helper', $this->service->getHelper());
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
diff --git a/app/Controllers/Admin/BoardController.php b/app/Controllers/Admin/BoardController.php
index a3bca13..3f0b1c1 100644
--- a/app/Controllers/Admin/BoardController.php
+++ b/app/Controllers/Admin/BoardController.php
@@ -18,99 +18,22 @@ class BoardController extends AdminController
$this->addActionPaths('board');
}
//Action작업관련
- protected function action_init_process(string $action): 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return UserEntity::class;
}
//기본 함수 작업
//Custom 추가 함수
- // public function notice(): ResponseInterface
- // {
- // $this->getService()->setAction(__FUNCTION__);
- // $this->getService()->setFormFields();
- // //전달값정의
- // $this->getService()->setFormDatas($this->request->getGet());
- // $formDatas = $this->getSErvice()->getFormDatas();
- // return $this->response->setJSON($this->getService()->getLatest(
- // array_key_exists('category', $formDatas) && $formDatas['category'] ? $formDatas['category'] : BOARD['CATEGORY']['NOTICE'],
- // ));
- // }
- // public function reqeusttask(): ResponseInterface
- // {
- // $this->getService()->setAction(__FUNCTION__);
- // $this->getService()->setFormFields();
- // //전달값정의
- // $this->getService()->setFormDatas($this->request->getGet());
- // $formDatas = $this->getSErvice()->getFormDatas();
- // return $this->response->setJSON($this->getService()->getLatest(
- // array_key_exists('category', $formDatas) && $formDatas['category'] ? $formDatas['category'] : BOARD['CATEGORY']['NOTICE'],
- // ['worker_uid' => $this->getMyAuth()->getUIDByAuthInfo()]
- // ));
- // }
+ public function latest(string $category): ResponseInterface
+ {
+ $action = __FUNCTION__;
+ $this->action_init_process($action);
+ return $this->response->setJSON($this->service->getLatest($category));
+ }
+ public function reqeusttask(): ResponseInterface
+ {
+ $action = __FUNCTION__;
+ $this->action_init_process($action);
+ return $this->response->setJSON($this->service->getRequestTaskCount($this->getAuthContext()->getUID()));
+ }
}
diff --git a/app/Controllers/Admin/Customer/AccountController.php b/app/Controllers/Admin/Customer/AccountController.php
index 75d10d0..082107d 100644
--- a/app/Controllers/Admin/Customer/AccountController.php
+++ b/app/Controllers/Admin/Customer/AccountController.php
@@ -50,9 +50,6 @@ class AccountController extends CustomerController
case 'download':
$fields = [...$fields, 'created_at'];
break;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
diff --git a/app/Controllers/Admin/Customer/ClientController.php b/app/Controllers/Admin/Customer/ClientController.php
index c917fce..bf47ad8 100644
--- a/app/Controllers/Admin/Customer/ClientController.php
+++ b/app/Controllers/Admin/Customer/ClientController.php
@@ -17,60 +17,6 @@ class ClientController extends CustomerController
}
$this->addActionPaths('client');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- 'site',
- 'name',
- 'email',
- 'phone',
- 'role',
- ];
- $filters = [
- 'site',
- 'role',
- 'status',
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status'];
- parent::action_init_process($action);
- 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',
- 'name',
- 'email',
- 'phone',
- 'role',
- 'account_balance',
- 'coupon_balance',
- 'point_balance',
- 'status',
- 'created_at',
- 'updated_at',
- ];
- break;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return ClientEntity::class;
diff --git a/app/Controllers/Admin/Customer/CouponController.php b/app/Controllers/Admin/Customer/CouponController.php
index 0c65cfb..2724177 100644
--- a/app/Controllers/Admin/Customer/CouponController.php
+++ b/app/Controllers/Admin/Customer/CouponController.php
@@ -21,47 +21,6 @@ class CouponController extends CustomerController
{
return CouponEntity::class;
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "clientinfo_uid",
- "title",
- "cnt",
- "status",
- "content",
- ];
- $filters = [
- "clientinfo_uid",
- "status",
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status'];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
//기본 함수 작업
//Custom 추가 함수
}
diff --git a/app/Controllers/Admin/Customer/PointController.php b/app/Controllers/Admin/Customer/PointController.php
index ded2fe8..3bcefe4 100644
--- a/app/Controllers/Admin/Customer/PointController.php
+++ b/app/Controllers/Admin/Customer/PointController.php
@@ -17,47 +17,6 @@ class PointController extends CustomerController
}
$this->addActionPaths('point');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "clientinfo_uid",
- "title",
- "content",
- "amount",
- "status",
- ];
- $filters = [
- "clientinfo_uid",
- "status",
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status'];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return PointEntity::class;
diff --git a/app/Controllers/Admin/Customer/ServiceController.php b/app/Controllers/Admin/Customer/ServiceController.php
index a90d7af..900d277 100644
--- a/app/Controllers/Admin/Customer/ServiceController.php
+++ b/app/Controllers/Admin/Customer/ServiceController.php
@@ -17,75 +17,6 @@ class ServiceController extends CustomerController
}
$this->addActionPaths('service');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "site",
- "location",
- "clientinfo_uid",
- 'serverinfo_uid',
- "rack",
- "line",
- "title",
- "start_at",
- "billing_at",
- "status",
- 'sale',
- 'amount',
- "history",
- ];
- $filters = [
- 'site',
- 'location',
- 'clientinfo_uid',
- 'serverinfo_uid',
- 'user_uid',
- 'status',
- ];
- $indexFilter = $filters;
- $batchjobFilters = [
- 'site',
- 'location',
- 'clientinfo_uid',
- 'status'
- ];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return ServiceEntity::class;
diff --git a/app/Controllers/Admin/Equipment/LineController.php b/app/Controllers/Admin/Equipment/LineController.php
index db4fbeb..19cfbbe 100644
--- a/app/Controllers/Admin/Equipment/LineController.php
+++ b/app/Controllers/Admin/Equipment/LineController.php
@@ -18,48 +18,6 @@ class LineController extends EquipmentController
}
$this->addActionPaths('line');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "type",
- "title",
- "bandwith",
- "start_at",
- "end_at",
- ];
- $filters = [
- "clientinfo_uid",
- "status",
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status'];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return LineEntity::class;
diff --git a/app/Controllers/Admin/Equipment/ServerController.php b/app/Controllers/Admin/Equipment/ServerController.php
index 0647a3c..b441dfc 100644
--- a/app/Controllers/Admin/Equipment/ServerController.php
+++ b/app/Controllers/Admin/Equipment/ServerController.php
@@ -17,52 +17,6 @@ class ServerController extends EquipmentController
}
$this->addActionPaths('server');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "code",
- "type",
- "switch",
- "ip",
- "os",
- "title",
- "price",
- "manufactur_at",
- "format_at",
- ];
- $filters = [
- "clientinfo_uid",
- "status",
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status'];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return ServerEntity::class;
diff --git a/app/Controllers/Admin/Equipment/ServerPartController.php b/app/Controllers/Admin/Equipment/ServerPartController.php
index a3920a1..7f502c9 100644
--- a/app/Controllers/Admin/Equipment/ServerPartController.php
+++ b/app/Controllers/Admin/Equipment/ServerPartController.php
@@ -17,54 +17,6 @@ class ServerPartController extends EquipmentController
}
$this->addActionPaths('serverpart');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "serverinfo_uid",
- "type",
- "billing",
- "part_uid",
- "title",
- "cnt",
- "extra",
- "amount",
- ];
- $filters = [
- "serverinfo_uid",
- "type",
- "part_uid",
- "billing",
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['billing', 'type'];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
-
protected function getEntityClass(): string
{
return ServerPartEntity::class;
diff --git a/app/Controllers/Admin/Home.php b/app/Controllers/Admin/Home.php
index 257e1dc..dab93e8 100644
--- a/app/Controllers/Admin/Home.php
+++ b/app/Controllers/Admin/Home.php
@@ -16,23 +16,30 @@ class Home extends AbstractWebController
//Index,FieldForm관련
public function welcome(): string
{
- $dashboards = [];
- foreach (service('trafficservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity)
- $dashboards[] = $this->action_render_process(
- 'dashboard',
- [
- 'layout' => 'admin',
- 'entity' => $entity
- ],
- 'traffic'
- );
+ //요청업무
+ $boardRequestTaskCount = service('boardservice')->getRequestTaskCount($this->getAuthContext()->getUID());
+ //Total 서버 현황
+ //interval을 기준으로 최근 신규 서비스정보 가져오기
+ $interval = intval($this->request->getVar('interval') ?? SERVICE['NEW_INTERVAL']);
+ $newServiceEntities = service('customer_serviceservice')->getNewServiceEntities($interval);
+ $newServiceCount = count($newServiceEntities);
+ //서비스별 미납 Count
+ $unPaidTotalCount = $unPaidTotalAmount = 0;
+ foreach (array_values(service('paymentservice')->getUnPaids('serviceinfo_uid')) as $unPaid) {
+ $unPaidTotalCount += $unPaid['cnt'];
+ $unPaidTotalAmount += $unPaid['amount'];
+ }
return $this->action_render_process(
__FUNCTION__,
[
'authContext' => $this->getAuthContext(),
- 'classPath' => service('trafficservice')->getClassPaths(false),
'layout' => 'admin',
- 'dashboards' => $dashboards
+ 'boardRequestTaskCount' => $boardRequestTaskCount,
+ 'interval' => $interval,
+ 'newServiceEntities' => $newServiceEntities,
+ 'newServiceCount' => $newServiceCount,
+ 'unPaidTotalCount' => $unPaidTotalCount,
+ 'unPaidTotalAmount' => $unPaidTotalAmount,
]
);
}
diff --git a/app/Controllers/Admin/MylogController.php b/app/Controllers/Admin/MylogController.php
index 1fa601d..1b9857e 100644
--- a/app/Controllers/Admin/MylogController.php
+++ b/app/Controllers/Admin/MylogController.php
@@ -17,38 +17,6 @@ class MylogController extends AdminController
}
$this->addActionPaths('mylog');
}
- protected function action_init_process(string $action): void
- {
- $fields = ['title', 'content'];
- $filters = [];
- $indexFilter = $filters;
- $batchjobFilters = $filters;
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return MylogEntity::class;
diff --git a/app/Controllers/Admin/Part/CPUController.php b/app/Controllers/Admin/Part/CPUController.php
index b591e65..dda0192 100644
--- a/app/Controllers/Admin/Part/CPUController.php
+++ b/app/Controllers/Admin/Part/CPUController.php
@@ -17,45 +17,6 @@ class CPUController extends PartController
}
$this->addActionPaths('cpu');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "title",
- "price",
- "stock",
- ];
- $filters = [
- "status",
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status'];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return CPUEntity::class;
diff --git a/app/Controllers/Admin/Part/CSController.php b/app/Controllers/Admin/Part/CSController.php
index ae6b86d..fbb9f8f 100644
--- a/app/Controllers/Admin/Part/CSController.php
+++ b/app/Controllers/Admin/Part/CSController.php
@@ -17,72 +17,6 @@ class CSController extends PartController
}
$this->addActionPaths('cs');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "type",
- "ip",
- "accountid",
- "domain",
- "price",
- ];
- $filters = [
- "clientinfo_uid",
- 'serverinfo_uid',
- 'type',
- 'status'
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status'];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return CSEntity::class;
diff --git a/app/Controllers/Admin/Part/DISKController.php b/app/Controllers/Admin/Part/DISKController.php
index 4d0772b..a4b5734 100644
--- a/app/Controllers/Admin/Part/DISKController.php
+++ b/app/Controllers/Admin/Part/DISKController.php
@@ -17,47 +17,6 @@ class DISKController extends PartController
}
$this->addActionPaths('disk');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "title",
- "price",
- "stock",
- ];
- $filters = [
- "status",
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status'];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);;
- }
-
protected function getEntityClass(): string
{
return DISKEntity::class;
diff --git a/app/Controllers/Admin/Part/IPController.php b/app/Controllers/Admin/Part/IPController.php
index 545868b..2b2db53 100644
--- a/app/Controllers/Admin/Part/IPController.php
+++ b/app/Controllers/Admin/Part/IPController.php
@@ -17,63 +17,6 @@ class IPController extends PartController
}
$this->addActionPaths('ip');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "lineinfo_uid",
- "ip",
- "price",
- ];
- $filters = [
- 'old_clientinfo_uid',
- 'clientinfo_uid',
- 'serverinfo_uid',
- "lineinfo_uid",
- 'status'
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status'];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return IPEntity::class;
diff --git a/app/Controllers/Admin/Part/RAMController.php b/app/Controllers/Admin/Part/RAMController.php
index e691925..10c5f7e 100644
--- a/app/Controllers/Admin/Part/RAMController.php
+++ b/app/Controllers/Admin/Part/RAMController.php
@@ -17,46 +17,6 @@ class RAMController extends PartController
}
$this->addActionPaths('ram');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "title",
- "price",
- "stock",
- ];
- $filters = [
- "status",
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status'];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
-
protected function getEntityClass(): string
{
return RAMEntity::class;
diff --git a/app/Controllers/Admin/Part/SOFTWAREController.php b/app/Controllers/Admin/Part/SOFTWAREController.php
index e8eeb8a..970d527 100644
--- a/app/Controllers/Admin/Part/SOFTWAREController.php
+++ b/app/Controllers/Admin/Part/SOFTWAREController.php
@@ -17,46 +17,6 @@ class SOFTWAREController extends PartController
}
$this->addActionPaths('software');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "title",
- "price",
- "stock",
- ];
- $filters = [
- "status",
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status'];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
-
protected function getEntityClass(): string
{
return SOFTWAREEntity::class;
diff --git a/app/Controllers/Admin/Part/SWITCHController.php b/app/Controllers/Admin/Part/SWITCHController.php
index b2461d9..cd346bb 100644
--- a/app/Controllers/Admin/Part/SWITCHController.php
+++ b/app/Controllers/Admin/Part/SWITCHController.php
@@ -17,65 +17,6 @@ class SWITCHController extends PartController
}
$this->addActionPaths('switch');
}
- protected function action_init_process(string $action): void
- {
- $fields = [
- "code",
- "price",
- ];
- $filters = [
- 'clientinfo_uid',
- 'serviceinfo_uid',
- 'serverinfo_uid',
- 'status'
- ];
- $indexFilter = $filters;
- $batchjobFilters = ['status',];
- parent::action_init_process($action);
- 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
-
protected function getEntityClass(): string
{
return SWITCHEntity::class;
diff --git a/app/Controllers/Admin/PaymentController.php b/app/Controllers/Admin/PaymentController.php
index 8eecf28..1f86c17 100644
--- a/app/Controllers/Admin/PaymentController.php
+++ b/app/Controllers/Admin/PaymentController.php
@@ -18,73 +18,6 @@ class PaymentController extends AdminController
$this->addActionPaths('payment');
}
//Action작업관련
- protected function action_init_process(string $action): void
- {
- $fields = [
- "serviceinfo_uid",
- "title",
- "amount",
- "billing",
- "billing_at",
- "content ",
- ];
- $filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
- $indexFilter = ['serviceinfo_uid', 'status', 'billing'];
- $batchjobFilters = ['status'];
- switch ($action) {
- case 'create':
- case 'create_form':
- break;
- case 'modify':
- case 'modify_form':
- $fields = ['title', 'amount', 'pay', 'status', 'content'];
- 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',
- 'status',
- 'updated_at',
- 'countdown',
- 'user_uid',
- 'created_at'
- ];
- break;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return PaymentEntity::class;
diff --git a/app/Controllers/Admin/UserController.php b/app/Controllers/Admin/UserController.php
index b27c34a..3a4810c 100644
--- a/app/Controllers/Admin/UserController.php
+++ b/app/Controllers/Admin/UserController.php
@@ -18,47 +18,6 @@ class UserController extends AdminController
$this->addActionPaths('user');
}
//Action작업관련
- protected function action_init_process(string $action): 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;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setIndexFilters($indexFilter);
- $this->service->getFormService()->setBatchjobFilters($batchjobFilters);
- parent::action_init_process($action);
- }
protected function getEntityClass(): string
{
return UserEntity::class;
diff --git a/app/Controllers/Auth/AuthController.php b/app/Controllers/Auth/AuthController.php
index 7f3b714..4be4d7d 100644
--- a/app/Controllers/Auth/AuthController.php
+++ b/app/Controllers/Auth/AuthController.php
@@ -23,6 +23,7 @@ abstract class AuthController extends AbstractWebController
}
protected function action_init_process(string $action): void
{
+ $this->service->action_init_process($action);
parent::action_init_process($action);
$this->addViewDatas('layout', $this->getLayout());
$this->addViewDatas('helper', $this->service->getHelper());
diff --git a/app/Controllers/Auth/GoogleController.php b/app/Controllers/Auth/GoogleController.php
index 636b9c6..fd67d64 100644
--- a/app/Controllers/Auth/GoogleController.php
+++ b/app/Controllers/Auth/GoogleController.php
@@ -17,25 +17,6 @@ class GoogleController extends AuthController
$this->service = service('googleauth');
}
}
- protected function action_init_process(string $action): void
- {
- parent::action_init_process($action);
- $fields = ['access_code'];
- $filters = [];
- switch ($action) {
- case 'login':
- case 'login_form':
- break;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setBatchjobFilters($filters);
- }
public function login_form_process(): void
{
//구글 로그인 BUTTON용
diff --git a/app/Controllers/Auth/LocalController.php b/app/Controllers/Auth/LocalController.php
index e7b8539..81167b6 100644
--- a/app/Controllers/Auth/LocalController.php
+++ b/app/Controllers/Auth/LocalController.php
@@ -22,25 +22,6 @@ class LocalController extends AuthController
$this->service = service('localauth');
}
}
- protected function action_init_process(string $action): void
- {
- parent::action_init_process($action);
- $fields = ['id', 'passwd'];
- $filters = [];
- switch ($action) {
- case 'login':
- case 'login_form':
- break;
- default:
- throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
- // break;
- }
- $this->service->getFormService()->setFormFields($fields);
- $this->service->getFormService()->setFormRules($action, $fields);
- $this->service->getFormService()->setFormFilters($filters);
- $this->service->getFormService()->setFormOptions($filters);
- $this->service->getFormService()->setBatchjobFilters($filters);
- }
//로그인처리
protected function login_process(): UserEntity
{
diff --git a/app/Controllers/CommonController.php b/app/Controllers/CommonController.php
index 0b29566..ed1c250 100644
--- a/app/Controllers/CommonController.php
+++ b/app/Controllers/CommonController.php
@@ -5,7 +5,6 @@ namespace App\Controllers;
use App\Entities\CommonEntity;
use CodeIgniter\HTTP\DownloadResponse;
use CodeIgniter\HTTP\RedirectResponse;
-use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Exceptions\ValidationException;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Reader\Html;
diff --git a/app/Services/Auth/AuthService.php b/app/Services/Auth/AuthService.php
index 0f0fb39..cf0975c 100644
--- a/app/Services/Auth/AuthService.php
+++ b/app/Services/Auth/AuthService.php
@@ -27,6 +27,7 @@ abstract class AuthService
$this->model = $model; // 모델을 직접 주입받아 자식에게 전달
$this->addClassPaths('Auth');
}
+ abstract public function action_init_process(string $action);
abstract public function getFormService(): mixed;
final public function getHelper(): AuthHelper
{
diff --git a/app/Services/Auth/GoogleService.php b/app/Services/Auth/GoogleService.php
index 24ce3bd..5b02f5a 100644
--- a/app/Services/Auth/GoogleService.php
+++ b/app/Services/Auth/GoogleService.php
@@ -33,6 +33,22 @@ class GoogleService extends AuthService
}
return $this->_form;
}
+ public function action_init_process(string $action): void
+ {
+ parent::action_init_process($action);
+ $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($filters);
+ $this->getFormService()->setBatchjobFilters($filters);
+ }
protected function getEntity_process(mixed $entity): UserEntity
{
return $entity;
diff --git a/app/Services/Auth/LocalService.php b/app/Services/Auth/LocalService.php
index e94b451..c82db81 100644
--- a/app/Services/Auth/LocalService.php
+++ b/app/Services/Auth/LocalService.php
@@ -33,6 +33,22 @@ class LocalService extends AuthService
}
return $this->_form;
}
+ public function action_init_process(string $action): void
+ {
+ parent::action_init_process($action);
+ $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($filters);
+ $this->getFormService()->setBatchjobFilters($filters);
+ }
protected function getEntity_process(mixed $entity): UserEntity
{
return $entity;
diff --git a/app/Services/BoardService.php b/app/Services/BoardService.php
index a8c0341..a229ddb 100644
--- a/app/Services/BoardService.php
+++ b/app/Services/BoardService.php
@@ -50,6 +50,68 @@ class BoardService extends CommonService
}
return $this->_helper;
}
+ public function action_init_process(string $action): 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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): BoardEntity
{
@@ -83,12 +145,12 @@ class BoardService extends CommonService
//추가기능부분
//Category별 최근 $limit갯수만큼 게시물
- public function getLatest(string $category, array $where = []): array
+ public function getLatest(string $category): array
{
//관리자정보
$userEntities = service('userservice')->getEntities();
$datas = [];
- foreach ($this->getEntities(['category' => $category, 'status' => STATUS['AVAILABLE'], ...$where]) as $entity) {
+ foreach ($this->getEntities(['category' => $category, 'status' => STATUS['AVAILABLE']]) as $entity) {
$datas[] = [
'title' => "",
'created_at' => date('Y-m-d H:m', strtotime($entity->getCreatedAT())),
@@ -97,14 +159,13 @@ class BoardService extends CommonService
}
return $datas;
}
- //요청업무 게시물
+ //요청업무 갯수(Home에서 사용)
public function getRequestTaskCount(int $worker_uid): int
{
- $where = [
+ return count($this->getEntities([
'category' => BOARD['CATEGORY']['REQUESTTASK'],
'worker_uid' => $worker_uid,
- 'status' => STATUS['AVAILABLE'],
- ];
- return count($this->getEntities($where));
+ 'status' => STATUS['AVAILABLE']
+ ]));
}
}
diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php
index 156c943..4bbcfe2 100644
--- a/app/Services/CommonService.php
+++ b/app/Services/CommonService.php
@@ -25,7 +25,7 @@ abstract class CommonService
{
return $isArray ? $this->_classPaths : implode($delimeter, $this->_classPaths);
}
-
+ abstract public function action_init_process(string $action);
/**
* 단일 엔티티를 조회합니다.
* @return CommonEntity|null CommonEntity 인스턴스 또는 찾지 못했을 경우 null
@@ -83,7 +83,6 @@ abstract class CommonService
throw new \Exception($errorMessage, $e->getCode(), $e);
}
}
-
final public function getNextPK(): int
{
$pkField = $this->model->getPKField();
diff --git a/app/Services/Customer/ClientService.php b/app/Services/Customer/ClientService.php
index 7bbfa52..63f7466 100644
--- a/app/Services/Customer/ClientService.php
+++ b/app/Services/Customer/ClientService.php
@@ -50,6 +50,55 @@ class ClientService extends CustomerService
}
return $this->_helper;
}
+ public function action_init_process(string $action): void
+ {
+ $fields = [
+ 'site',
+ 'name',
+ 'email',
+ 'phone',
+ 'role',
+ ];
+ $filters = [
+ 'site',
+ 'role',
+ 'status',
+ ];
+ $indexFilter = $filters;
+ $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 = [
+ '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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): ClientEntity
{
diff --git a/app/Services/Customer/CouponService.php b/app/Services/Customer/CouponService.php
index f60c2fa..20721ce 100644
--- a/app/Services/Customer/CouponService.php
+++ b/app/Services/Customer/CouponService.php
@@ -50,6 +50,42 @@ class CouponService extends CustomerService
}
return $this->_helper;
}
+ public function action_init_process(string $action): void
+ {
+ $fields = [
+ "clientinfo_uid",
+ "title",
+ "cnt",
+ "status",
+ "content",
+ ];
+ $filters = [
+ "clientinfo_uid",
+ "status",
+ ];
+ $indexFilter = $filters;
+ $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 = [...$fields, 'created_at'];
+ break;
+ }
+ $this->getFormService()->setFormFields($fields);
+ $this->getFormService()->setFormRules($action, $fields);
+ $this->getFormService()->setFormFilters($filters);
+ $this->getFormService()->setFormOptions($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): CouponEntity
{
diff --git a/app/Services/Customer/PointService.php b/app/Services/Customer/PointService.php
index 3b1f35a..6e11290 100644
--- a/app/Services/Customer/PointService.php
+++ b/app/Services/Customer/PointService.php
@@ -50,6 +50,42 @@ class PointService extends CustomerService
}
return $this->_helper;
}
+ public function action_init_process(string $action): void
+ {
+ $fields = [
+ "clientinfo_uid",
+ "title",
+ "content",
+ "amount",
+ "status",
+ ];
+ $filters = [
+ "clientinfo_uid",
+ "status",
+ ];
+ $indexFilter = $filters;
+ $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 = [...$fields, 'created_at'];
+ break;
+ }
+ $this->getFormService()->setFormFields($fields);
+ $this->getFormService()->setFormRules($action, $fields);
+ $this->getFormService()->setFormFilters($filters);
+ $this->getFormService()->setFormOptions($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): PointEntity
{
diff --git a/app/Services/Customer/ServiceService.php b/app/Services/Customer/ServiceService.php
index f2fda59..b3c3f2c 100644
--- a/app/Services/Customer/ServiceService.php
+++ b/app/Services/Customer/ServiceService.php
@@ -7,6 +7,8 @@ use App\Entities\Customer\ServiceEntity;
use App\Forms\Customer\ServiceForm;
use App\Helpers\Customer\ServiceHelper;
use App\Models\Customer\ServiceModel;
+use DateTimeImmutable;
+use DateTimeZone;
use RuntimeException;
class ServiceService extends CustomerService
@@ -50,6 +52,70 @@ class ServiceService extends CustomerService
}
return $this->_helper;
}
+ public function action_init_process(string $action): void
+ {
+ $fields = [
+ "site",
+ "location",
+ "clientinfo_uid",
+ 'serverinfo_uid',
+ "rack",
+ "line",
+ "title",
+ "start_at",
+ "billing_at",
+ "status",
+ 'sale',
+ 'amount',
+ "history",
+ ];
+ $filters = [
+ 'site',
+ 'location',
+ '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;
+ }
+ $this->getFormService()->setFormFields($fields);
+ $this->getFormService()->setFormRules($action, $fields);
+ $this->getFormService()->setFormFilters($filters);
+ $this->getFormService()->setFormOptions($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): ServiceEntity
{
@@ -92,4 +158,57 @@ class ServiceService extends CustomerService
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리
+ //추가 기능
+ //interval을 기준으로 최근 신규 서비스정보 가져오기
+ final public function getNewServiceEntities(int $interval, string $status = ServiceEntity::DEFAULT_STATUS): array
+ {
+ return $this->getEntities(sprintf("start_at >= NOW()-INTERVAL {$interval} DAY AND status = '%s'", $status));
+ }
+ //서비스별 총 금액
+ final public function getTotalAmounts($where = []): array
+ {
+ $rows = $this->model->groupBy('clientinfo_uid')->select("clientinfo_uid,SUM(amount) AS amount")
+ ->where($where)
+ ->get()->getResult();
+ $amounts = [];
+ foreach ($rows as $row) {
+ $amounts[$row->clientinfo_uid] = $row->amount;
+ }
+ return $amounts;
+ }
+ //다음 달로 결제일 가져오기.
+ final public function getNextMonthDate(ServiceEntity $entity): string
+ {
+ // $sql = "UPDATE serviceinfo SET billing_at =
+ // IF(DAY(billing_at) > DAY(LAST_DAY(billing_at)),
+ // LAST_DAY(DATE_ADD(billing_at, INTERVAL 1 MONTH)),
+ // DATE_ADD(billing_at, INTERVAL 1 MONTH)
+ // ) WHERE uid = ?";
+ // return $this->model->query($sql, [$entity->getPK()]);
+ // 입력된 날짜를 DateTime 객체로 변환
+ $date = new DateTimeImmutable($entity->getBillingAt(), new DateTimeZone('Asia/Tokyo'));
+ // 현재 일(day)을 저장
+ $day = (int)$date->format('d');
+ // 다음달로 이동 (DateInterval 사용)
+ $date->modify('first day of next month');
+ // 다음달의 마지막 날 계산
+ $lastDayOfNextMonth = (int)$date->format('t');
+ // 현재 날짜가 다음달의 마지막 날보다 크면 -> 마지막 날로 설정
+ if ($day > $lastDayOfNextMonth) {
+ $day = $lastDayOfNextMonth;
+ }
+ // 일(day)을 설정
+ $date->setDate((int)$date->format('Y'), (int)$date->format('m'), $day);
+ // 최종 결과 리턴 (YYYY-MM-DD)
+ return $date->format('Y-m-d');
+ }
+ //서비스금액관련처리
+ // public function setAmount(ServiceEntity $entity, int $calculatedServerAmount, string $callBack = "updateForService"): ServiceEntity
+ // {
+ // //기본:상면비+회선비+서버금액(price)+서버파트연결(월비용)-할인액
+ // $amount = $entity->getRack() + $entity->getLine() + $calculatedServerAmount - $entity->getSale();
+ // //결제정보 반영
+ // $paymentEntity = $this->getPaymentService()->$callBack($entity, $amount);
+ // return $this->model->modify($entity, ['amount' => $amount, 'payment_uid' => $paymentEntity->getPK()]);
+ // }
}
diff --git a/app/Services/Equipment/LineService.php b/app/Services/Equipment/LineService.php
index 285ebb1..70877a7 100644
--- a/app/Services/Equipment/LineService.php
+++ b/app/Services/Equipment/LineService.php
@@ -50,6 +50,43 @@ class LineService extends EquipmentService
}
return $this->_helper;
}
+ public function action_init_process(string $action): void
+ {
+ $fields = [
+ "type",
+ "title",
+ "bandwith",
+ "start_at",
+ "end_at",
+ ];
+ $filters = [
+ "clientinfo_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, '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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): LineEntity
{
diff --git a/app/Services/Equipment/ServerPartService.php b/app/Services/Equipment/ServerPartService.php
index b240ab6..df1b9e6 100644
--- a/app/Services/Equipment/ServerPartService.php
+++ b/app/Services/Equipment/ServerPartService.php
@@ -50,6 +50,48 @@ class ServerPartService extends EquipmentService
}
return $this->_helper;
}
+ public function action_init_process(string $action): void
+ {
+ $fields = [
+ "serverinfo_uid",
+ "type",
+ "billing",
+ "part_uid",
+ "title",
+ "cnt",
+ "extra",
+ "amount",
+ ];
+ $filters = [
+ "serverinfo_uid",
+ "type",
+ "part_uid",
+ "billing",
+ ];
+ $indexFilter = $filters;
+ $batchjobFilters = ['billing', 'type'];
+ 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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): ServerPartEntity
{
diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php
index d14602e..ab050d2 100644
--- a/app/Services/Equipment/ServerService.php
+++ b/app/Services/Equipment/ServerService.php
@@ -50,6 +50,47 @@ class ServerService extends EquipmentService
}
return $this->_helper;
}
+ public function action_init_process(string $action): void
+ {
+ $fields = [
+ "code",
+ "type",
+ "switch",
+ "ip",
+ "os",
+ "title",
+ "price",
+ "manufactur_at",
+ "format_at",
+ ];
+ $filters = [
+ "clientinfo_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, '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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): ServerEntity
{
@@ -92,4 +133,98 @@ class ServerService extends EquipmentService
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리
+ //추가기능
+ final public function getTotalServiceCount(array $where = []): array
+ {
+ $totalCounts = [
+ 'chiba_summary' => 0,
+ 'tokyo_summary' => 0,
+ 'all_summary' => 0,
+ 'normal' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
+ 'defence' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
+ 'dedicated' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
+ 'alternative' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
+ 'vpn' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
+ 'event' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
+ 'test' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
+ ];
+ $builder = $this->model->select("serverinfo.type,
+ COUNT(CASE WHEN serviceinfo.location = 'chiba' THEN 1 END) AS chiba,
+ COUNT(CASE WHEN serviceinfo.location = 'tokyo' THEN 1 END) AS tokyo,
+ COUNT(CASE WHEN serviceinfo.location IN ('chiba', 'tokyo') THEN 1 END) AS summary")
+ ->join('serviceinfo', 'serviceinfo.uid = serverinfo.serviceinfo_uid')
+ ->where($where)
+ ->groupBy('serverinfo.type')
+ ->builder();
+ // echo $builder->getCompiledSelect(false) . "
"; //초기화 없이 SQL만 보고 싶을 때: getCompiledSelect(false) ← 꼭 false!
+ // dd($rows);
+ foreach ($builder->get()->getResult() as $row) {
+ $totalCounts[$row->type]['chiba'] = $row->chiba;
+ $totalCounts[$row->type]['tokyo'] = $row->tokyo;
+ $totalCounts[$row->type]['summary'] += $row->summary;
+ $totalCounts['chiba_summary'] += $row->chiba;
+ $totalCounts['tokyo_summary'] += $row->tokyo;
+ $totalCounts['all_summary'] = $totalCounts['chiba_summary'] + $totalCounts['tokyo_summary'];
+ }
+ // dd($totalCounts);
+ return $totalCounts;
+ }
+ //검색어에 따른 서버정보를 검색 후 해당하는 서비스리스트를 가져온다.
+ final public function getSearchServices(string $keyword): array
+ {
+ $builder = $this->model->distinct()->select('serverinfo.serviceinfo_uid AS serviceinfo_uid')
+ ->join('clientinfo', 'clientinfo.uid = serverinfo.clientinfo_uid')
+ ->join('serverpartinfo', 'serverpartinfo.clientinfo_uid = clientinfo.uid', 'left')
+ ->groupStart()
+ ->like('clientinfo.name', $keyword, 'both', null, true) // escape=true
+ ->orLike('serverinfo.code', $keyword, 'both', null, true)
+ ->orLike('serverinfo.ip', $keyword, 'both', null, true)
+ ->orLike('serverinfo.title', $keyword, 'both', null, true)
+ ->orLike('serverpartinfo.title', $keyword, 'both', null, true)
+ ->groupEnd()
+ ->builder();
+ // echo $builder->getCompiledSelect(false); //초기화 없이 SQL만 보고 싶을 때: getCompiledSelect(false) ← 꼭 false!
+ $rows = $builder->get()->getResult();
+ if (!count($rows)) {
+ return [];
+ }
+ return $rows;
+ }
+ //서버 Title별 카운트수
+ final public function getStockCount(): array
+ {
+ $builder = $this->model->select('title,COUNT(*) AS cnt')->groupBy('title')->builder();
+ // echo $builder->getCompiledSelect(false); //초기화 없이 SQL만 보고 싶을 때: getCompiledSelect(false) ← 꼭 false!
+ // dd($builder->get()->getResult());
+ $rows = [];
+ foreach ($builder->get()->getResult() as $row) {
+ $rows[$row->title] = $row->cnt;
+ }
+ return $rows;
+ }
+ // public function getCalculatedAmount(ServerEntity $entity): int
+ // {
+ // $caculatedAmount = $entity->getPrice();
+ // //해당 서비스(서버) 관련 결제방식(Billing)이 Month인 ServerPart 전체를 다시 검사하여 월청구액을 합산한다.
+ // foreach ($this->getServerPartService()->getEntities(['serverinfo_uid' => $entity->getPK()]) as $serverPartEntity) {
+ // if ($serverPartEntity->getBilling() === PAYMENT['BILLING']['MONTH']) { //월비용일때만 적용
+ // $caculatedAmount += $serverPartEntity->getTotalAmount(); //단가*Cnt
+ // }
+ // }
+ // return $caculatedAmount;
+ // }
+ // //결제관련처리
+ // public function setAmount(ServerEntity $entity): ServerEntity
+ // {
+ // if ($entity->getServiceInfoUID() === null) {
+ // throw new \Exception(__METHOD__ . "에서 오류발생: 서비스정보가 정의된 후에만 가능합니다.");
+ // }
+ // //서비스정보 반영
+ // $serviceEntity = $this->getServiceService()->getEntity($entity->getServiceInfoUID());
+ // if (!$serviceEntity instanceof ServiceEntity) {
+ // throw new \Exception(__METHOD__ . "에서 오류발생: {$entity->getServiceInfoUID()} 서비스 정보를 찾을수 없습니다.");
+ // }
+ // $this->getServiceService()->setAmount($serviceEntity, $this->getCalculatedAmount($entity));
+ // return $entity;
+ // }
}
diff --git a/app/Services/MylogService.php b/app/Services/MylogService.php
index 0c02efe..52b403c 100644
--- a/app/Services/MylogService.php
+++ b/app/Services/MylogService.php
@@ -38,6 +38,33 @@ class MylogService extends CommonService implements PipelineStepInterface
}
return $this->_form;
}
+ public function action_init_process(string $action): void
+ {
+ $fields = ['title', 'content'];
+ $filters = [];
+ $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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
public function getHelper(): MylogHelper
{
if ($this->_helper === null) {
diff --git a/app/Services/Part/CPUService.php b/app/Services/Part/CPUService.php
index 6a10c9b..39eaa8b 100644
--- a/app/Services/Part/CPUService.php
+++ b/app/Services/Part/CPUService.php
@@ -50,6 +50,40 @@ class CPUService extends PartService
}
return $this->_helper;
}
+ public function action_init_process(string $action): 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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): CPUEntity
{
diff --git a/app/Services/Part/CSService.php b/app/Services/Part/CSService.php
index 19689c5..edfd376 100644
--- a/app/Services/Part/CSService.php
+++ b/app/Services/Part/CSService.php
@@ -50,6 +50,67 @@ class CSService extends PartService
}
return $this->_helper;
}
+ public function action_init_process(string $action): 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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): CSEntity
{
diff --git a/app/Services/Part/DISKService.php b/app/Services/Part/DISKService.php
index 5084b1a..7144586 100644
--- a/app/Services/Part/DISKService.php
+++ b/app/Services/Part/DISKService.php
@@ -50,6 +50,42 @@ class DISKService extends PartService
}
return $this->_helper;
}
+ public function action_init_process(string $action): 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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
+
//기본 기능부분
protected function getEntity_process(mixed $entity): DISKEntity
{
diff --git a/app/Services/Part/IPService.php b/app/Services/Part/IPService.php
index 3150651..5236831 100644
--- a/app/Services/Part/IPService.php
+++ b/app/Services/Part/IPService.php
@@ -50,6 +50,58 @@ class IPService extends PartService
}
return $this->_helper;
}
+ public function action_init_process(string $action): 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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): IPEntity
{
diff --git a/app/Services/Part/RAMService.php b/app/Services/Part/RAMService.php
index 9c310dd..f85085e 100644
--- a/app/Services/Part/RAMService.php
+++ b/app/Services/Part/RAMService.php
@@ -50,6 +50,40 @@ class RAMService extends PartService
}
return $this->_helper;
}
+ public function action_init_process(string $action): 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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): RAMEntity
{
diff --git a/app/Services/Part/SOFTWAREService.php b/app/Services/Part/SOFTWAREService.php
index 1262d31..ef8b82e 100644
--- a/app/Services/Part/SOFTWAREService.php
+++ b/app/Services/Part/SOFTWAREService.php
@@ -36,6 +36,41 @@ class SOFTWAREService extends PartService
}
return $this->_form;
}
+ public function action_init_process(string $action): 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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ parent::action_init_process($action);
+ }
public function getHelper(): SOFTWAREHelper
{
if ($this->_helper === null) {
diff --git a/app/Services/Part/SWITCHService.php b/app/Services/Part/SWITCHService.php
index fa05f62..adaa503 100644
--- a/app/Services/Part/SWITCHService.php
+++ b/app/Services/Part/SWITCHService.php
@@ -50,6 +50,60 @@ class SWITCHService extends PartService
}
return $this->_helper;
}
+ public function action_init_process(string $action): 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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ parent::action_init_process($action);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): SWITCHEntity
{
diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php
index 14d2967..517aba6 100644
--- a/app/Services/PaymentService.php
+++ b/app/Services/PaymentService.php
@@ -50,6 +50,70 @@ class PaymentService extends CommonService
}
return $this->_helper;
}
+ public function action_init_process(string $action): void
+ {
+ $fields = [
+ "serviceinfo_uid",
+ "title",
+ "amount",
+ "billing",
+ "billing_at",
+ "content ",
+ ];
+ $filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
+ $indexFilter = ['serviceinfo_uid', 'status', 'billing'];
+ $batchjobFilters = ['status'];
+ switch ($action) {
+ case 'create':
+ case 'create_form':
+ break;
+ case 'modify':
+ case 'modify_form':
+ $fields = ['title', 'amount', 'pay', 'status', 'content'];
+ 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',
+ 'status',
+ 'updated_at',
+ 'countdown',
+ 'user_uid',
+ 'created_at'
+ ];
+ break;
+ }
+ $this->getFormService()->setFormFields($fields);
+ $this->getFormService()->setFormRules($action, $fields);
+ $this->getFormService()->setFormFilters($filters);
+ $this->getFormService()->setFormOptions($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ parent::action_init_process($action);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): PaymentEntity
{
@@ -108,4 +172,20 @@ class PaymentService extends CommonService
$this->model->orLike($this->model->getTable() . '.email', $word, 'both');
parent::setSearchWord($word);
}
+ //추가기능
+ //총 미납건수, 금액
+ final public function getUnPaids(string $group, array $where = []): array
+ {
+ $builder = $this->model->groupBy($group)
+ ->select("{$group},COUNT(uid) as cnt, SUM(amount) as amount")
+ ->where(['status' => STATUS['UNPAID']])
+ ->where($where)
+ ->builder();
+ // echo $builder->getCompiledSelect(false); //초기화 없이 SQL만 보고 싶을 때: getCompiledSelect(false) ← 꼭 false!
+ $unPaids = [];
+ foreach ($builder->get()->getResult() as $row) {
+ $unPaids[$row->$group] = ['cnt' => $row->cnt, 'amount' => $row->amount];
+ }
+ return $unPaids;
+ }
}
diff --git a/app/Services/UserService.php b/app/Services/UserService.php
index dcc6f4f..27fb99c 100644
--- a/app/Services/UserService.php
+++ b/app/Services/UserService.php
@@ -50,6 +50,43 @@ class UserService extends CommonService
}
return $this->_helper;
}
+ public function action_init_process(string $action): 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($filters);
+ $this->getFormService()->setIndexFilters($indexFilter);
+ $this->getFormService()->setBatchjobFilters($batchjobFilters);
+ }
//기본 기능부분
protected function getEntity_process(mixed $entity): UserEntity
{
diff --git a/app/Views/admin/welcome.php b/app/Views/admin/welcome.php
index 186d9e5..e1bf981 100644
--- a/app/Views/admin/welcome.php
+++ b/app/Views/admin/welcome.php
@@ -3,9 +3,28 @@
| + + = $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?> + + | +
+
+ = $this->include("{$viewDatas['layout']}/welcome/banner"); ?>
+
+
+
+
+ = $this->include("{$viewDatas['layout']}/welcome/total_service"); ?>
+ = $this->include("{$viewDatas['layout']}/welcome/new_service"); ?>
+ = $this->include("{$viewDatas['layout']}/welcome/stock"); ?>
+
+ = $this->include("{$viewDatas['layout']}/welcome/mylog"); ?>
+ |
+
| 사이트 | +업체명 | ++ ALL 📋 장비번호 / 스위치정보 / IP정보 / CS정보 + | +등록자 | +
|---|---|---|---|
| = SITES[$entity->getSite()] ?> | += $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?> | += view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [ + 'serverinfo_uid' => $entity->getServerInfoUID(), + 'types' => SERVERPART['SERVICE_PARTTYPES'], + 'template' => 'partlist_service' + ]) ?> | += $viewDatas['service']->getHelper()->getFieldView('user_uid', $entity->getUserUID(), $viewDatas) ?> | +
| 사용 서버 | +메모리 재고 | +저장장치 재고 | +
|---|---|---|
| = view_cell("\App\Cells\Equipment\ServerCell::stock") ?> | += view_cell("\App\Cells\Part\RAMCell::stock") ?> | += view_cell("\App\Cells\Part\DISKCell::stock") ?> | +
| 사이트 | +일반 | +방어 | +전용 | +대체 | +VPN | +이벤트 | +테스트 | +합계 | +|||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 도쿄 | +치바 | +도쿄 | +치바 | +도쿄 | +치바 | +도쿄 | +치바 | +도쿄 | +치바 | +도쿄 | +치바 | +도쿄 | +치바 | +도쿄 | +치바 | +합계 | +|