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 @@
| [상세정보] | -사이트 | -위치 | -형식 | -CPU | -메모리 | -저장장치 | -OS | -SOFTWARE | -IP주소 | -CS | -결제처리 | -||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
- = $serviceEntity->getCode() ?>
- = $serviceEntity->getServerEntity()->getCode() ?>
- |
- = $viewDatas['serviceService']->getHelper()->getFieldView('site', $serviceEntity->getSite(), $viewDatas) ?> | -= $viewDatas['serviceService']->getHelper()->getFieldView('location', $serviceEntity->getLocation(), $viewDatas) ?> | -= $viewDatas['serviceService']->getHelper()->getFieldView('type', $serviceEntity->getType(), $viewDatas) ?> | -CPU | -메모리 | -저장장치 | -OS | -SOFTWARE | -IP주소 | -CS | -
-
|
- ||||||
| 서비스 비고 | -|||||||||||||||||
| 서비스 비고 | -|||||||||||||||||
| [상세정보] | +사이트 | +위치 | +형식 | +CPU | +메모리 | +저장장치 | +OS | +SOFTWARE | +IP주소 | +CS | +결제처리 | +||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
+ = $entity->getCode() ?>
+ = $entity->getServerEntity()->getCode() ?>
+ |
+ = $cellDatas['service']->getHelper()->getFieldView('site', $entity->getSite(), $cellDatas) ?> | += $cellDatas['service']->getHelper()->getFieldView('location', $entity->getLocation(), $cellDatas) ?> | += $cellDatas['service']->getHelper()->getFieldView('type', $entity->getType(), $cellDatas) ?> | += $cellDatas['service']->getHelper()->getFieldView('CPU', "", $cellDatas) ?> | += $cellDatas['service']->getHelper()->getFieldView('RAM', "", $cellDatas) ?> | += $cellDatas['service']->getHelper()->getFieldView('DISK', "", $cellDatas) ?> | += $cellDatas['service']->getHelper()->getFieldView('OS', "", $cellDatas) ?> | += $cellDatas['service']->getHelper()->getFieldView('SOFTWARE', "", $cellDatas) ?> | += $cellDatas['service']->getHelper()->getFieldView('IP', "", $cellDatas) ?> | += $cellDatas['service']->getHelper()->getFieldView('CS', "", $cellDatas) ?> | +
+
|
+ ||||||
| 서비스 비고 | +|||||||||||||||||
| = nl2br($entity->getHistory()) ?> | +|||||||||||||||||