94 lines
3.0 KiB
PHP
94 lines
3.0 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Admin;
|
|
|
|
use App\Entities\PaymentEntity;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
class PaymentController extends AdminController
|
|
{
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
if ($this->service === null) {
|
|
$this->service = service('paymentservice');
|
|
}
|
|
$this->addActionPaths('payment');
|
|
}
|
|
//Action작업관련
|
|
protected function action_init_process(string $action): void
|
|
{
|
|
$fields = [
|
|
"serviceinfo_uid",
|
|
"title",
|
|
"amount",
|
|
"billing",
|
|
"billing_at",
|
|
"content ",
|
|
];
|
|
$filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
|
|
$batchjobFilters = ['status'];
|
|
switch ($action) {
|
|
case 'create':
|
|
case 'create_form':
|
|
break;
|
|
case 'modify':
|
|
case 'modify_form':
|
|
$fields = ['title', 'amount', 'pay', 'status', 'content'];
|
|
break;
|
|
case 'view':
|
|
$fields = [
|
|
'clientinfo_uid',
|
|
"serviceinfo_uid",
|
|
'billing',
|
|
'title',
|
|
'amount',
|
|
'billing_at',
|
|
'pay',
|
|
'status',
|
|
'updated_at',
|
|
'countdown',
|
|
'user_uid',
|
|
'created_at',
|
|
'content'
|
|
];
|
|
break;
|
|
case 'index':
|
|
case 'download':
|
|
$fields = [
|
|
'clientinfo_uid',
|
|
"serviceinfo_uid",
|
|
'billing',
|
|
'title',
|
|
'amount',
|
|
'billing_at',
|
|
'pay',
|
|
'status',
|
|
'updated_at',
|
|
'countdown',
|
|
'user_uid',
|
|
'created_at'
|
|
];
|
|
$filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing'];
|
|
break;
|
|
default:
|
|
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
|
|
// break;
|
|
}
|
|
$this->service->getFormService()->setFormFields($fields);
|
|
$this->service->getFormService()->setFormRules($action, $fields);
|
|
$this->service->getFormService()->setFormFilters($filters);
|
|
$this->service->getFormService()->setFormOptions($filters);
|
|
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
parent::action_init_process($action);
|
|
}
|
|
protected function getEntityClass(): string
|
|
{
|
|
return PaymentEntity::class;
|
|
}
|
|
//기본 함수 작업
|
|
//Custom 추가 함수
|
|
}
|