dbms/app/Controllers/Admin/Customer/CustomerController.php
2025-05-06 19:08:29 +09:00

45 lines
1.4 KiB
PHP

<?php
namespace App\Controllers\Admin\Customer;
use App\Controllers\Admin\AdminController;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\Customer\ClientService;
abstract class CustomerController extends AdminController
{
private $_clientrService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->uri_path .= 'customer/';
$this->uri_path .= "customer/";
// $this->view_path .= "customer" . DIRECTORY_SEPARATOR;
}
final public function getClientService(): ClientService
{
if (!$this->_clientrService) {
$this->_clientrService = new ClientService($this->request);
}
return $this->_clientrService;
}
//Index,FieldForm관련
protected function getFormFieldOption(string $field, array $options = []): array
{
switch ($field) {
case 'clientinfo_uid':
$options[$field] = $this->getClientService()->getFormFieldOption($field);
// echo $this->getUserModel()->getLastQuery();
// dd($options);
break;
default:
$options = parent::getFormFieldOption($field, $options);
break;
}
return $options;
}
//Index,FieldForm관련
}