51 lines
2.2 KiB
PHP
51 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Admin;
|
|
|
|
use App\Controllers\AbstractWebController;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
class Home extends AbstractWebController
|
|
{
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
if ($this->service === null) {
|
|
$this->service = service('customer_serviceservice');
|
|
}
|
|
$this->addActionPaths('home');
|
|
}
|
|
protected function action_init_process(string $action, array $formDatas = []): void
|
|
{
|
|
// $this->service->action_init_process($action, $entity);
|
|
parent::action_init_process($action, $formDatas);
|
|
$this->addViewDatas('layout', LAYOUTS['admin']);
|
|
}
|
|
//Index,FieldForm관련
|
|
public function welcome(): string
|
|
{
|
|
$action = __FUNCTION__;
|
|
$this->action_init_process($action);
|
|
//요청업무
|
|
$this->addViewDatas('boardRequestTaskCount', service('boardservice')->getRequestTaskCount($this->getAuthContext()->getUID()));
|
|
//Total 서버 현황
|
|
//interval을 기준으로 최근 신규 서비스정보 가져오기
|
|
$interval = intval($this->request->getVar('interval') ?? SERVICE['NEW_INTERVAL']);
|
|
$this->addViewDatas('interval', $interval);
|
|
$newServiceEntities = $this->service->getNewServiceEntities($interval);
|
|
$this->addViewDatas('newServiceEntities', $newServiceEntities);
|
|
$this->addViewDatas('newServiceCount', count($newServiceEntities));
|
|
//서비스별 미납 Count
|
|
$unPaidTotalCount = $unPaidTotalAmount = 0;
|
|
foreach (array_values(service('paymentservice')->getUnPaids('serviceinfo_uid')) as $unPaid) {
|
|
$unPaidTotalCount += $unPaid['cnt'];
|
|
$unPaidTotalAmount += $unPaid['amount'];
|
|
}
|
|
$this->addViewDatas('unPaidTotalCount', $unPaidTotalCount);
|
|
$this->addViewDatas('unPaidTotalAmount', $unPaidTotalAmount);
|
|
return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate'));
|
|
}
|
|
}
|