From 7fb1a2b1d714c0fa111944d43e407e705243bb61 Mon Sep 17 00:00:00 2001 From: "choi.jh" Date: Wed, 10 Sep 2025 20:23:18 +0900 Subject: [PATCH] dbmsv2 init...1 --- app/Cells/CommonCell.php | 19 ++++ app/Cells/Customer/CustomerCell.php | 15 +++ app/Cells/Customer/ServiceCell.php | 32 ++++++ .../Admin/Customer/ClientController.php | 2 - app/Entities/Customer/ServiceEntity.php | 4 + app/Services/Customer/PaymentService.php | 10 +- app/Services/Customer/ServiceService.php | 2 + app/Views/admin/client/detail.php | 98 ++++--------------- app/Views/cells/service/detail.php | 60 ++++++++++++ 9 files changed, 154 insertions(+), 88 deletions(-) create mode 100644 app/Cells/CommonCell.php create mode 100644 app/Cells/Customer/CustomerCell.php create mode 100644 app/Cells/Customer/ServiceCell.php create mode 100644 app/Views/cells/service/detail.php diff --git a/app/Cells/CommonCell.php b/app/Cells/CommonCell.php new file mode 100644 index 0000000..83225fe --- /dev/null +++ b/app/Cells/CommonCell.php @@ -0,0 +1,19 @@ +_service = $service; + } + final public function getService(): mixed + { + return $this->_service; + } +} diff --git a/app/Cells/Customer/CustomerCell.php b/app/Cells/Customer/CustomerCell.php new file mode 100644 index 0000000..df55dfd --- /dev/null +++ b/app/Cells/Customer/CustomerCell.php @@ -0,0 +1,15 @@ +getService()->setAction(__FUNCTION__); + $this->getService()->setFormFields(); + $this->getService()->setFormFilters(); + $this->getService()->setFormRules(); + $this->getService()->setFormOptions(); + $entities = $this->getService()->getEntities(['clientinfo_uid' => $params['userinfo_uid']]); + return view('cells/service/detail', [ + 'cellDatas' => [ + 'control' => $this->getService()->getControlDatas(), + 'service' => $this->getService(), + 'entities' => $entities, + 'paymentService' => new PaymentService() + ] + ]); + } +} diff --git a/app/Controllers/Admin/Customer/ClientController.php b/app/Controllers/Admin/Customer/ClientController.php index 075c15b..20f8728 100644 --- a/app/Controllers/Admin/Customer/ClientController.php +++ b/app/Controllers/Admin/Customer/ClientController.php @@ -118,8 +118,6 @@ class ClientController extends CustomerController $this->serviceEntities = $this->getService()->getServiceService()->getEntities(['clientinfo_uid' => $entity->getPK()]); $this->entity = $entity; helper(['form']); - $this->serviceService = new ServiceService(); - $this->serverServicer = new ServerService(); return $this->getResultSuccess(); } catch (\Exception $e) { return $e->getMessage(); diff --git a/app/Entities/Customer/ServiceEntity.php b/app/Entities/Customer/ServiceEntity.php index 8f3ed72..dc4be3f 100644 --- a/app/Entities/Customer/ServiceEntity.php +++ b/app/Entities/Customer/ServiceEntity.php @@ -62,4 +62,8 @@ class ServiceEntity extends CustomerEntity { return $this->attributes['amount'] ?? 0; } + public function getHistory(): string + { + return $this->attributes['history'] ?? ""; + } } diff --git a/app/Services/Customer/PaymentService.php b/app/Services/Customer/PaymentService.php index 9d8b9a6..78e4fc3 100644 --- a/app/Services/Customer/PaymentService.php +++ b/app/Services/Customer/PaymentService.php @@ -100,17 +100,11 @@ class PaymentService extends CustomerService public function getUnPaids(string $group, array $where = []): array { $rows = $this->getModel()->groupBy($group) - ->select("{$group}, COUNT(uid) as cnt, SUM(amount) as amount") + ->select("COUNT(uid) as cnt, SUM(amount) as amount") ->where(['billing_at <=' => date('Y-m-d')]) ->where(['status' => STATUS['UNPAID']]) ->where($where) ->get()->getResult(); - $unpaids = []; - foreach ($rows as $row) { - $unpaids[$row->$group] = [];; - $unpaids[$row->$group]['count'] = $row->cnt; - $unpaids[$row->$group]['amount'] = $row->amount; - } - return $unpaids; + return $rows; } } diff --git a/app/Services/Customer/ServiceService.php b/app/Services/Customer/ServiceService.php index d028c2f..fc290ea 100644 --- a/app/Services/Customer/ServiceService.php +++ b/app/Services/Customer/ServiceService.php @@ -199,6 +199,8 @@ class ServiceService extends CustomerService ) WHERE billing_at = ? AND status = ?"; return $this->getModel()->query($sql, [$billing_at, $status]); } + //기본기능 + //서버정보 상태설정용 private function setServer_process(ServiceEntity $entity, mixed $serverinfo_uid, string $status): ServiceEntity { diff --git a/app/Views/admin/client/detail.php b/app/Views/admin/client/detail.php index a1d67e7..bc96374 100644 --- a/app/Views/admin/client/detail.php +++ b/app/Views/admin/client/detail.php @@ -55,87 +55,29 @@ getAccountBalance() ?> getPK(), $viewDatas['totalAmounts']) ? number_format($viewDatas['totalAmounts'][$viewDatas['entity']->getPK()]) : 0 ?> getPK(), $viewDatas['unPaids']) ? number_format($viewDatas['unPaids'][$viewDatas['entity']->getPK()]['amount']) : 0 ?> + + + +
+
+
고객 비고
+
+
+ +
+
+ +
+
+ $viewDatas['entity']->getPK()]) ?> + + + + + - -
-
-
고객 비고
-
-
- -
-
- -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[상세정보]사이트위치형식CPU메모리저장장치OSSOFTWAREIP주소CS결제처리
-
getCode() ?>
-
getServerEntity()->getCode() ?>
-
getHelper()->getFieldView('site', $serviceEntity->getSite(), $viewDatas) ?>getHelper()->getFieldView('location', $serviceEntity->getLocation(), $viewDatas) ?>getHelper()->getFieldView('type', $serviceEntity->getType(), $viewDatas) ?>CPU메모리저장장치OSSOFTWAREIP주소CS - - - - - - - - - - - - - -
결제일2025-09-11
결제금500,000
미납금500,000
-
서비스 비고
서비스 비고
-
- - - - - - - - -
include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/cells/service/detail.php b/app/Views/cells/service/detail.php new file mode 100644 index 0000000..23dc4ac --- /dev/null +++ b/app/Views/cells/service/detail.php @@ -0,0 +1,60 @@ + + + getUnPaids('serviceinfo_uid', ['serviceinfo_uid' => $entity->getPK()]) ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[상세정보]사이트위치형식CPU메모리저장장치OSSOFTWAREIP주소CS결제처리
+
getCode() ?>
+
getServerEntity()->getCode() ?>
+
getHelper()->getFieldView('site', $entity->getSite(), $cellDatas) ?>getHelper()->getFieldView('location', $entity->getLocation(), $cellDatas) ?>getHelper()->getFieldView('type', $entity->getType(), $cellDatas) ?>getHelper()->getFieldView('CPU', "", $cellDatas) ?>getHelper()->getFieldView('RAM', "", $cellDatas) ?>getHelper()->getFieldView('DISK', "", $cellDatas) ?>getHelper()->getFieldView('OS', "", $cellDatas) ?>getHelper()->getFieldView('SOFTWARE', "", $cellDatas) ?>getHelper()->getFieldView('IP', "", $cellDatas) ?>getHelper()->getFieldView('CS', "", $cellDatas) ?> + + + + + + + + + + + + + +
결제일getBillingAT() ?>
결제금getBillingAT())) ?>원
미납금
+
서비스 비고
getHistory()) ?>
+
+ \ No newline at end of file