From 3ad960fd5930616e776e05c7b89328277a0f103f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Fri, 11 Apr 2025 15:46:14 +0900 Subject: [PATCH] dbms_primeidc_init...1 --- .../DBMS/Client/CouponController.php | 27 +++++++++++- extdbms/lib/Services/ServiceService.php | 5 ++- .../lib/Views/dbms/client/coupon/client.php | 44 +++++++++++++++++++ .../lib/Views/dbms/client/coupon/index.php | 11 +---- .../WebContent/jsp/cupon/IdcCouponListMK.jsp | 2 +- .../WebContent/jsp/cupon/IdcCouponUseMK.jsp | 2 +- 6 files changed, 77 insertions(+), 14 deletions(-) create mode 100644 extdbms/lib/Views/dbms/client/coupon/client.php diff --git a/extdbms/lib/Controllers/DBMS/Client/CouponController.php b/extdbms/lib/Controllers/DBMS/Client/CouponController.php index 5a70ed6..4b84c8b 100644 --- a/extdbms/lib/Controllers/DBMS/Client/CouponController.php +++ b/extdbms/lib/Controllers/DBMS/Client/CouponController.php @@ -38,10 +38,33 @@ class CouponController extends ClientController } return $this->_historyService; } - //IdcCouponUseMK.jsp -> domain_coupon_use.php + + //IdcCouponListMK.jsp -> domain_coupon.php //CLI 접속방법 : php index.php site/client/counpon/index //WEB 접속방법 : http://localhost/site/client/coupon/index public function index(array $params) + { + //전체 관리자정보(등록자) + if (!array_key_exists('mkid', $params)) { + throw new \Exception("mkid 값이 정의되지 않았습니다."); + } + //쿠폰내역 + $this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1); + $this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE); + [$this->total, $this->services] = $this->getServiceService()->getEntitiesForCoupon($this->curPage, $this->perPage); + $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage); + $total_coupon = 0; + foreach ($this->services as $service) { + $total_coupon += $service->getCoupon(); + } + $this->total_coupon = $total_coupon; + return $this->render(__FUNCTION__); + } + + //IdcCouponUseMK.jsp -> domain_coupon_use.php + //CLI 접속방법 : php index.php site/client/counpon/client/client_code/코드 + //WEB 접속방법 : http://localhost/site/client/coupon/client/client_code/코드 + public function client(array $params) { //사용자정보 if (!array_key_exists('client_code', $params)) { @@ -66,7 +89,7 @@ class CouponController extends ClientController //쿠폰내역 $this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1); $this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE); - [$this->total, $this->services] = $this->getServiceService()->getEntitiesByClient($this->curPage, $this->perPage, $client_code); + [$this->total, $this->services] = $this->getServiceService()->getEntitiesForCoupon($this->curPage, $this->perPage, $client_code); $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage); $total_coupon = 0; foreach ($this->services as $service) { diff --git a/extdbms/lib/Services/ServiceService.php b/extdbms/lib/Services/ServiceService.php index 6982206..74481f7 100644 --- a/extdbms/lib/Services/ServiceService.php +++ b/extdbms/lib/Services/ServiceService.php @@ -38,8 +38,11 @@ class ServiceService extends CommonService } //사용자별 서비스리스트트 - public function getEntitiesByClient(int $curPage, int $perPage, string $client_code): array + public function getEntitiesForCoupon(int $curPage, int $perPage, ?string $client_code = null): array { + if ($client_code) { + $this->getModel()->where("client_code", $client_code); + } $this->getModel()->where("client_code", $client_code); $this->getModel()->whereNotIn("service_line", ['vpn', 'test', 'solo', 'substitution', 'event']); //Query문 Rest여부 -> 같은조건에 Count 받고, 결과값을 받고 싶을때는 continue() diff --git a/extdbms/lib/Views/dbms/client/coupon/client.php b/extdbms/lib/Views/dbms/client/coupon/client.php new file mode 100644 index 0000000..ad8917b --- /dev/null +++ b/extdbms/lib/Views/dbms/client/coupon/client.php @@ -0,0 +1,44 @@ +

고객명 : client->getTitle() ?> / 쿠폰발급대상 : services) ?> 대 / 전체 남은 수량 : total_coupon; ?> 개

+
+ + + + + + + + + + + + + + + + + + + services as $service) { ?> + services) - $i; ?> + + + + + + + + + + + getCoupon()) { ?> + + + + + + + + +
No서비스코드장비명서버IP서비스개시일회선종류쿠폰 누적수쿠폰 잔량수쿠폰 사용수사용
getServiceCode() ?>getServerCode() ?>service_ip ?>service_open_date ?>service_line ?>getCoupon() + $service->getUsedCoupon() ?>getCoupon() ?>getUsedCoupon() ?>사용완료사용하기
+
+
pagination->render(DBMS_SITE_URL . "/IdcCouponUseMK.cup", ['client_code' => $this->client->getClientCode(), 'member_code' => $this->member->getPK(), 'curPage' => $this->curPage, 'perPage' => $this->perPage]) ?>
\ No newline at end of file diff --git a/extdbms/lib/Views/dbms/client/coupon/index.php b/extdbms/lib/Views/dbms/client/coupon/index.php index ad8917b..aa7e4a8 100644 --- a/extdbms/lib/Views/dbms/client/coupon/index.php +++ b/extdbms/lib/Views/dbms/client/coupon/index.php @@ -1,4 +1,3 @@ -

고객명 : client->getTitle() ?> / 쿠폰발급대상 : services) ?> 대 / 전체 남은 수량 : total_coupon; ?> 개

@@ -13,7 +12,6 @@ - @@ -28,17 +26,12 @@ - + - getCoupon()) { ?> - - - -
쿠폰 누적수 쿠폰 잔량수 쿠폰 사용수사용
service_open_date ?> service_line ?> getCoupon() + $service->getUsedCoupon() ?>getCoupon() ?>getCoupon() ?> getUsedCoupon() ?>사용완료사용하기
-
pagination->render(DBMS_SITE_URL . "/IdcCouponUseMK.cup", ['client_code' => $this->client->getClientCode(), 'member_code' => $this->member->getPK(), 'curPage' => $this->curPage, 'perPage' => $this->perPage]) ?>
\ No newline at end of file +
pagination->render(DBMS_SITE_URL . "/IdcCouponListMK.cup", ['curPage' => $this->curPage, 'perPage' => $this->perPage]) ?>
\ No newline at end of file diff --git a/idcproject/WebContent/jsp/cupon/IdcCouponListMK.jsp b/idcproject/WebContent/jsp/cupon/IdcCouponListMK.jsp index 3cf72b4..db5dd1b 100644 --- a/idcproject/WebContent/jsp/cupon/IdcCouponListMK.jsp +++ b/idcproject/WebContent/jsp/cupon/IdcCouponListMK.jsp @@ -58,7 +58,7 @@ $(function()
- +
diff --git a/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp b/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp index 1e60c0e..30d74f6 100644 --- a/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp +++ b/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp @@ -11,7 +11,7 @@

도메인 쿠폰 사용하기

- +