47 lines
1.8 KiB
PHP
47 lines
1.8 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);
|
|
}
|
|
//Index,FieldForm관련
|
|
public function welcome(): string
|
|
{
|
|
//요청업무
|
|
$boardRequestTaskCount = service('boardservice')->getRequestTaskCount($this->getAuthContext()->getUID());
|
|
//Total 서버 현황
|
|
//interval을 기준으로 최근 신규 서비스정보 가져오기
|
|
$interval = intval($this->request->getVar('interval') ?? SERVICE['NEW_INTERVAL']);
|
|
$newServiceEntities = service('customer_serviceservice')->getNewServiceEntities($interval);
|
|
$newServiceCount = count($newServiceEntities);
|
|
//서비스별 미납 Count
|
|
$unPaidTotalCount = $unPaidTotalAmount = 0;
|
|
foreach (array_values(service('paymentservice')->getUnPaids('serviceinfo_uid')) as $unPaid) {
|
|
$unPaidTotalCount += $unPaid['cnt'];
|
|
$unPaidTotalAmount += $unPaid['amount'];
|
|
}
|
|
return $this->action_render_process(
|
|
__FUNCTION__,
|
|
[
|
|
'authContext' => $this->getAuthContext(),
|
|
'layout' => 'admin',
|
|
'boardRequestTaskCount' => $boardRequestTaskCount,
|
|
'interval' => $interval,
|
|
'newServiceEntities' => $newServiceEntities,
|
|
'newServiceCount' => $newServiceCount,
|
|
'unPaidTotalCount' => $unPaidTotalCount,
|
|
'unPaidTotalAmount' => $unPaidTotalAmount,
|
|
]
|
|
);
|
|
}
|
|
}
|