41 lines
1.4 KiB
PHP
41 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Cells\Customer;
|
|
|
|
use App\Helpers\Equipment\ServerPartHelper;
|
|
use App\Services\PaymentService;
|
|
|
|
class ServiceCell extends CustomerCell
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct(service('customer_serviceservice'));
|
|
}
|
|
|
|
public function detail(array $params): string
|
|
{
|
|
$this->getService()->action_init_process(__FUNCTION__);
|
|
//서비스별 미납 Count
|
|
$unPaids = service('paymentservice')->getUnPaids('serviceinfo_uid', ['clientinfo_uid' => $params['clientinfo_uid']]);
|
|
//서비스별 서버리스트
|
|
$entities = [];
|
|
$childServers = [];
|
|
foreach ($this->getService()->getEntities(['clientinfo_uid' => $params['clientinfo_uid']]) as $entity) {
|
|
$entities[] = $entity;
|
|
$childServers[$entity->getPK()] = service('equipment_serverservice')->getEntities(['serviceinfo_uid' => $entity->getPK()]);
|
|
}
|
|
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
|
return view('cells/service/' . $template, [
|
|
'serviceCellDatas' => [
|
|
'formFilters' => $this->getService()->getFormService()->getFormFilters(),
|
|
'formOptions' => $this->getService()->getFormService()->getFormOptions(),
|
|
'helper' => $this->getService()->getHelper(),
|
|
'unPaids' => $unPaids,
|
|
'entities' => $entities,
|
|
'childServers' => $childServers,
|
|
'serverPartHelper' => new ServerPartHelper(),
|
|
]
|
|
]);
|
|
}
|
|
}
|