68 lines
1.9 KiB
PHP
68 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Admin\Customer;
|
|
|
|
use App\Entities\Customer\CouponEntity;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
class CouponController extends CustomerController
|
|
{
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
if ($this->service === null) {
|
|
$this->service = service('customer_couponservice');
|
|
}
|
|
$this->addActionPaths('coupon');
|
|
}
|
|
protected function getEntityClass(): string
|
|
{
|
|
return CouponEntity::class;
|
|
}
|
|
protected function action_init_process(string $action): void
|
|
{
|
|
$fields = [
|
|
"clientinfo_uid",
|
|
"title",
|
|
"cnt",
|
|
"status",
|
|
"content",
|
|
];
|
|
$filters = [
|
|
"clientinfo_uid",
|
|
"status",
|
|
];
|
|
$indexFilter = $filters;
|
|
$batchjobFilters = ['status'];
|
|
parent::action_init_process($action);
|
|
switch ($action) {
|
|
case 'create':
|
|
case 'create_form':
|
|
case 'modify':
|
|
case 'modify_form':
|
|
break;
|
|
case 'view':
|
|
$fields = [...$fields, 'created_at'];
|
|
break;
|
|
case 'index':
|
|
case 'download':
|
|
$fields = [...$fields, 'created_at'];
|
|
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()->getIndexFilters($indexFilter);
|
|
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
|
|
parent::action_init_process($action);
|
|
}
|
|
//기본 함수 작업
|
|
//Custom 추가 함수
|
|
}
|