getView()->setPath('client'); } // final public function getClientService(): ClientService { if ($this->_clientService === null) { $this->_clientService = new ClientService(); } return $this->_clientService; } //서비스카운팅 , total_counting_customer.php //CLI 접속방법 : php index.php site/client/totalcount/client_code/코드번호 //WEB 접속방법 : http://localhost/site/client/totalcount/client_code/코드번호 public function totalcount() { //사용자정보 //사용자정보 $client_code = $this->request->get('client_code'); if ($client_code) { $client = $this->getClientService()->getEntity(); if (!$client) { throw new \Exception("[$client_code]에 해당하는 고객정보가 존재하지 않습니다."); } $this->client = $client; } //서비스위치별(치바,도쿄등) $dashboard = []; foreach (DBMS_SERVICE_SWITCHCODE as $district => $switchcodes) { $switchcode_begin = $switchcodes['begin']; $switchcode_end = $switchcodes['end']; $this->getServiceService()->getModel()->where("client_code", "{$client_code}"); $this->getServiceService()->getModel()->where("service_sw BETWEEN '{$switchcode_begin}' AND '{$switchcode_end}'"); $this->getServiceService()->getModel()->where("service_status", "o"); $this->getServiceService()->getModel()->whereNotIn("service_line", ['solo', 'test', 'event', 'substitution']); $dashboard[$district] = $this->getServiceService()->getCount(); } //foreach //서비스라인별(일반,방어,전용,테스트,대체,vpn,event등) foreach (DBMS_SERVICE_LINE_ALL as $service_line => $label) { $this->getServiceService()->getModel()->where('client_code', $client_code); $this->getServiceService()->getModel()->where('service_line', $service_line); $dashboard[$service_line] = $this->getServiceService()->getCount("SUM(coupon) as cnt"); } //foreach //서비스상태별(일반,방어만) $this->getServiceService()->getModel()->where("client_code", $client_code); $this->getServiceService()->getModel()->whereNotIn("service_line", ['solo', 'test', 'event', 'substitution']); $dashboard['coupon'] = $this->getServiceService()->getCount("SUM(coupon) as cnt"); $this->dashboard = $dashboard; $this->client_code = $client_code; return $this->render(__FUNCTION__); } } //Class