dbmsv2 init...1
This commit is contained in:
parent
4d898df50a
commit
383e3e4ac9
@ -24,9 +24,9 @@ $routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes)
|
|||||||
$routes->group('', ['namespace' => 'App\Controllers'], function ($routes) {
|
$routes->group('', ['namespace' => 'App\Controllers'], function ($routes) {
|
||||||
$routes->get('/', 'Home::index');
|
$routes->get('/', 'Home::index');
|
||||||
$routes->group('auth', ['namespace' => 'App\Controllers\Auth'], function ($routes) {
|
$routes->group('auth', ['namespace' => 'App\Controllers\Auth'], function ($routes) {
|
||||||
$routes->get('login', 'LocalController::create_form');
|
$routes->get('login', 'LocalController::login_form');
|
||||||
$routes->post('login', 'LocalController::create');
|
$routes->post('login', 'LocalController::login');
|
||||||
$routes->get('google_login', 'GoogleController::create');
|
$routes->get('google_login', 'GoogleController::login');
|
||||||
$routes->get('logout', 'LocalController::logout');
|
$routes->get('logout', 'LocalController::logout');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -45,8 +45,8 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
|
|||||||
$routes->post('batchjob', 'UserController::batchjob', ['filter' => 'authFilter:master']);
|
$routes->post('batchjob', 'UserController::batchjob', ['filter' => 'authFilter:master']);
|
||||||
$routes->post('batchjob_delete', 'UserController::batchjob_delete', ['filter' => 'authFilter:master']);
|
$routes->post('batchjob_delete', 'UserController::batchjob_delete', ['filter' => 'authFilter:master']);
|
||||||
$routes->get('download/(:alpha)', 'UserController::download/$1', ['filter' => 'authFilter:master']);
|
$routes->get('download/(:alpha)', 'UserController::download/$1', ['filter' => 'authFilter:master']);
|
||||||
$routes->get('profile_modify/(:num)', 'UserController::profile_modify_form/$1', ['filter' => 'authFilter:manager']);
|
$routes->get('profile/(:num)', 'UserController::profile_form/$1', ['filter' => 'authFilter:manager']);
|
||||||
$routes->post('profile_modify/(:num)', 'UserController::profile_modify/$1', ['filter' => 'authFilter:manager']);
|
$routes->post('profile/(:num)', 'UserController::profile/$1', ['filter' => 'authFilter:manager']);
|
||||||
});
|
});
|
||||||
$routes->group('mylog', ['namespace' => 'App\Controllers\Admin'], function ($routes) {
|
$routes->group('mylog', ['namespace' => 'App\Controllers\Admin'], function ($routes) {
|
||||||
$routes->get('/', 'MyLogController::index');
|
$routes->get('/', 'MyLogController::index');
|
||||||
|
|||||||
@ -61,7 +61,7 @@ class ClientController extends CustomerController
|
|||||||
$formDatas['user_uid'] = $this->getMyAuth()->getUIDByAuthInfo();
|
$formDatas['user_uid'] = $this->getMyAuth()->getUIDByAuthInfo();
|
||||||
return parent::modify_process($entity, $formDatas);
|
return parent::modify_process($entity, $formDatas);
|
||||||
}
|
}
|
||||||
protected function doValidation_process(Validation $validation, string $field, string $rule): Validation
|
protected function doValidation(Validation $validation, string $field, string $rule): Validation
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'role':
|
case 'role':
|
||||||
@ -69,7 +69,7 @@ class ClientController extends CustomerController
|
|||||||
$validation->setRule("{$field}.*", $field, $rule);
|
$validation->setRule("{$field}.*", $field, $rule);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$validation = parent::doValidation_process($validation, $field, $rule);
|
$validation = parent::doValidation($validation, $field, $rule);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $validation;
|
return $validation;
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class PaymentController extends CustomerController
|
|||||||
}
|
}
|
||||||
return $this->_clientService;
|
return $this->_clientService;
|
||||||
}
|
}
|
||||||
protected function getResultSuccess_process(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
||||||
{
|
{
|
||||||
switch ($this->getAction()) {
|
switch ($this->getAction()) {
|
||||||
case 'invoice':
|
case 'invoice':
|
||||||
@ -63,7 +63,7 @@ class PaymentController extends CustomerController
|
|||||||
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$result = parent::getResultSuccess_process($message, $actionTemplate);
|
$result = parent::getResultSuccess($message, $actionTemplate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
@ -141,9 +141,9 @@ class PaymentController extends CustomerController
|
|||||||
//각 Field 초기화
|
//각 Field 초기화
|
||||||
$this->initAction($this->getService()->getFormFields());
|
$this->initAction($this->getService()->getFormFields());
|
||||||
$this->invoice_process();
|
$this->invoice_process();
|
||||||
return $this->getResultSuccess_process();
|
return $this->getResultSuccess();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->getResultFail_process($e->getMessage());
|
return $this->getResultFail($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class ServerController extends EquipmentController
|
|||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
//Index,FieldForm관련
|
//Index,FieldForm관련
|
||||||
protected function getResultSuccess_process(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
||||||
{
|
{
|
||||||
switch ($this->getAction()) {
|
switch ($this->getAction()) {
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
@ -54,7 +54,7 @@ class ServerController extends EquipmentController
|
|||||||
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$result = parent::getResultSuccess_process($message, $actionTemplate);
|
$result = parent::getResultSuccess($message, $actionTemplate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
@ -66,7 +66,13 @@ class ServerController extends EquipmentController
|
|||||||
if (!$format) {
|
if (!$format) {
|
||||||
throw new \Exception(__METHOD__ . "에서 code의 format[Server.Prefix.code.format]이 정의되지 않았습니다.");
|
throw new \Exception(__METHOD__ . "에서 code의 format[Server.Prefix.code.format]이 정의되지 않았습니다.");
|
||||||
}
|
}
|
||||||
$this->setFieldDefaultValue('code', $this->getService()->getLastestCode($format, (int)env("Server.Default.code", 0)));
|
//기본값정의
|
||||||
|
$this->setFormDatas([
|
||||||
|
'code' => $this->getService()->getLastestCode(
|
||||||
|
$format,
|
||||||
|
(int)env("Server.Default.code", 0)
|
||||||
|
)
|
||||||
|
]);
|
||||||
parent::create_form_process();
|
parent::create_form_process();
|
||||||
}
|
}
|
||||||
//생성
|
//생성
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class Home extends AdminController
|
|||||||
}
|
}
|
||||||
return $this->_PaymentService;
|
return $this->_PaymentService;
|
||||||
}
|
}
|
||||||
protected function getResultSuccess_process(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
||||||
{
|
{
|
||||||
switch ($this->getAction()) {
|
switch ($this->getAction()) {
|
||||||
case 'index':
|
case 'index':
|
||||||
@ -59,7 +59,7 @@ class Home extends AdminController
|
|||||||
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$result = parent::getResultSuccess_process($message, $actionTemplate);
|
$result = parent::getResultSuccess($message, $actionTemplate);
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -68,10 +68,7 @@ class Home extends AdminController
|
|||||||
//Index,FieldForm관련
|
//Index,FieldForm관련
|
||||||
public function index(): RedirectResponse|string
|
public function index(): RedirectResponse|string
|
||||||
{
|
{
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
$this->setAction(__FUNCTION__);
|
||||||
//각 Field 초기화
|
|
||||||
$this->initAction($this->getService()->getIndexFields());
|
|
||||||
//Total 서버 현황
|
//Total 서버 현황
|
||||||
$this->totalCounts = $this->getService()->getTotalCountsByType();
|
$this->totalCounts = $this->getService()->getTotalCountsByType();
|
||||||
//interval을 기준으로 최근 신규 서비스정보 가져오기
|
//interval을 기준으로 최근 신규 서비스정보 가져오기
|
||||||
@ -82,6 +79,6 @@ class Home extends AdminController
|
|||||||
$this->unPaids = $this->getPaymentService()->getUnPaidCount();
|
$this->unPaids = $this->getPaymentService()->getUnPaidCount();
|
||||||
$this->unPaidCount = count($this->unPaids);
|
$this->unPaidCount = count($this->unPaids);
|
||||||
helper(['form']);
|
helper(['form']);
|
||||||
return $this->getResultSuccess_process();
|
return $this->getResultSuccess();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,14 +36,14 @@ class SearchController extends AdminController
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
protected function getResultSuccess_process(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
||||||
{
|
{
|
||||||
switch ($this->getAction()) {
|
switch ($this->getAction()) {
|
||||||
case 'index':
|
case 'index':
|
||||||
$result = parent::getResultSuccess_process($message, $this->request->getVar('ActionTemplate') ?? $actionTemplate ?? 'search');
|
$result = parent::getResultSuccess($message, $this->request->getVar('ActionTemplate') ?? $actionTemplate ?? 'search');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$result = parent::getResultSuccess_process($message, $actionTemplate);
|
$result = parent::getResultSuccess($message, $actionTemplate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class UserController extends AdminController
|
|||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
//Index,FieldForm관련
|
//Index,FieldForm관련
|
||||||
protected function getResultSuccess_process(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
||||||
{
|
{
|
||||||
switch ($this->getAction()) {
|
switch ($this->getAction()) {
|
||||||
case 'profile_modify':
|
case 'profile_modify':
|
||||||
@ -60,12 +60,12 @@ class UserController extends AdminController
|
|||||||
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$result = parent::getResultSuccess_process($message, $actionTemplate);
|
$result = parent::getResultSuccess($message, $actionTemplate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
protected function doValidation_process(Validation $validation, string $field, string $rule): Validation
|
protected function doValidation(Validation $validation, string $field, string $rule): Validation
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'role':
|
case 'role':
|
||||||
@ -73,56 +73,59 @@ class UserController extends AdminController
|
|||||||
$validation->setRule("{$field}.*", $field, $rule);
|
$validation->setRule("{$field}.*", $field, $rule);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$validation = parent::doValidation_process($validation, $field, $rule);
|
$validation = parent::doValidation($validation, $field, $rule);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $validation;
|
return $validation;
|
||||||
}
|
}
|
||||||
//Index,FieldForm관련.
|
//Index,FieldForm관련.
|
||||||
final public function profile_modify_form(mixed $uid): RedirectResponse|string
|
final public function profile_form(mixed $uid): RedirectResponse|string
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
$this->setAction(__FUNCTION__);
|
||||||
$this->initAction([
|
$this->setFormFields();
|
||||||
'fields' => ['id', 'passwd', 'confirmpassword', 'name', 'email', 'mobile'],
|
$this->setFormFilters();
|
||||||
]);
|
$this->setFormRules();
|
||||||
helper(['form']);
|
$this->setFormOptions();
|
||||||
|
//기본값정의
|
||||||
|
$this->setFormDatas($this->request->getGet());
|
||||||
//기존 Entity 가져오기
|
//기존 Entity 가져오기
|
||||||
$entity = $this->getService()->getEntity($uid);
|
$entity = $this->getService()->getEntity($uid);
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
||||||
}
|
}
|
||||||
$this->modify_form_process($entity);
|
$this->entity = $entity;
|
||||||
|
helper(['form']);
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
return $this->getResultSuccess_process();
|
return $this->getResultSuccess();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->getResultFail_process($e->getMessage());
|
return $this->getResultFail($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final public function profile_modify(int $uid): RedirectResponse|string
|
final public function profile(int $uid): RedirectResponse|string
|
||||||
{
|
{
|
||||||
//Transaction Start
|
//Transaction Start
|
||||||
|
$db = \Config\Database::connect();
|
||||||
$this->_db->transStart();
|
$this->_db->transStart();
|
||||||
try {
|
try {
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
$this->setAction(__FUNCTION__);
|
||||||
$this->initAction([
|
$this->setFormFields();
|
||||||
'fields' => ['id', 'passwd', 'confirmpassword', 'name', 'email', 'mobile'],
|
$this->setFormFilters();
|
||||||
]);
|
$this->setFormRules();
|
||||||
//전달값받기
|
//전달값정의
|
||||||
$formDatas = $this->getFormDatas($this->getControlDatas('actionFields'), $this->request->getPost());
|
$this->setFormDatas($this->request->getPost());
|
||||||
|
$this->doValidations();
|
||||||
//기존 Entity 가져오기
|
//기존 Entity 가져오기
|
||||||
$entity = $this->getService()->getEntity($uid);
|
$entity = $this->getService()->getEntity($uid);
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
||||||
}
|
}
|
||||||
$this->modify_process($entity, $formDatas);
|
$this->entity = $this->modify_process($entity, $this->getFormDatas());
|
||||||
$this->_db->transCommit();
|
$this->_db->transCommit();
|
||||||
return $this->getResultSuccess_process();
|
return $this->getResultSuccess();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->_db->transRollback();
|
$this->_db->transRollback();
|
||||||
return $this->getResultFail_process($e->getMessage());
|
return $this->getResultFail($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ namespace App\Controllers\Auth;
|
|||||||
|
|
||||||
use App\Controllers\CommonController;
|
use App\Controllers\CommonController;
|
||||||
|
|
||||||
|
use App\Entities\UserEntity;
|
||||||
use App\Helpers\AuthHelper;
|
use App\Helpers\AuthHelper;
|
||||||
use CodeIgniter\HTTP\RedirectResponse;
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
@ -22,6 +23,7 @@ abstract class AuthController extends CommonController
|
|||||||
$this->content_title = "사용자인증";
|
$this->content_title = "사용자인증";
|
||||||
}
|
}
|
||||||
abstract protected function getSNSButton(): string;
|
abstract protected function getSNSButton(): string;
|
||||||
|
abstract protected function login_process(array $formDatas): UserEntity;
|
||||||
final public function getHelper(): mixed
|
final public function getHelper(): mixed
|
||||||
{
|
{
|
||||||
if (!$this->_helper) {
|
if (!$this->_helper) {
|
||||||
@ -29,21 +31,21 @@ abstract class AuthController extends CommonController
|
|||||||
}
|
}
|
||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
protected function getResultFail_process(string $message = MESSAGES["FAILED"]): RedirectResponse
|
protected function getResultFail(string $message = MESSAGES["FAILED"]): RedirectResponse
|
||||||
{
|
{
|
||||||
if ($this->request->getMethod() === 'POST') {
|
if ($this->request->getMethod() === 'POST') {
|
||||||
return redirect()->back()->withInput()->with('error', $message);
|
return redirect()->back()->withInput()->with('error', $message);
|
||||||
}
|
}
|
||||||
return redirect()->to($this->getMyAuth()->popPreviousUrl())->with('error', $message);
|
return redirect()->to($this->getMyAuth()->popPreviousUrl())->with('error', $message);
|
||||||
}
|
}
|
||||||
protected function getResultSuccess_process(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
||||||
{
|
{
|
||||||
switch ($this->getAction()) {
|
switch ($this->getAction()) {
|
||||||
case 'create': //Login처리
|
case 'create': //Login처리
|
||||||
$result = redirect()->to($this->getMyAuth()->popPreviousUrl())->with('error', $message);
|
$result = redirect()->to($this->getMyAuth()->popPreviousUrl())->with('error', $message);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$result = parent::getResultSuccess_process($message, $actionTemplate);
|
$result = parent::getResultSuccess($message, $actionTemplate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
@ -53,10 +55,51 @@ abstract class AuthController extends CommonController
|
|||||||
return $formDatas;
|
return $formDatas;
|
||||||
}
|
}
|
||||||
//로그인화면
|
//로그인화면
|
||||||
public function create_form_process(): void
|
public function login_form_process(): void
|
||||||
{
|
{
|
||||||
$this->sns_buttoh = $this->getSNSButton();
|
$this->sns_buttoh = $this->getSNSButton();
|
||||||
}
|
}
|
||||||
|
public function login_form(): RedirectResponse|string
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$this->setAction(__FUNCTION__);
|
||||||
|
$this->setFormFields();
|
||||||
|
$this->setFormFilters();
|
||||||
|
$this->setFormRules();
|
||||||
|
$this->setFormOptions();
|
||||||
|
//기본값정의
|
||||||
|
$this->setFormDatas($this->request->getGet());
|
||||||
|
$this->login_form_process();
|
||||||
|
helper(['form']);
|
||||||
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
|
return $this->getResultSuccess();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
dd($e->getMessage());
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//로그인처리
|
||||||
|
public function login(): RedirectResponse|string
|
||||||
|
{
|
||||||
|
//Transaction Start
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
$db->transStart();
|
||||||
|
try {
|
||||||
|
$this->setAction(__FUNCTION__);
|
||||||
|
$this->setFormFields();
|
||||||
|
$this->setFormFilters();
|
||||||
|
$this->setFormRules();
|
||||||
|
//전달값정의
|
||||||
|
$this->setFormDatas($this->request->getPost());
|
||||||
|
$this->doValidations();
|
||||||
|
$this->entity = $this->login_process($this->getFormDatas());
|
||||||
|
$db->transCommit();
|
||||||
|
return $this->getResultSuccess();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$db->transRollback();
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
//로그아웃
|
//로그아웃
|
||||||
final public function logout(): RedirectResponse
|
final public function logout(): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class GoogleController extends AuthController
|
|||||||
}
|
}
|
||||||
|
|
||||||
//로그인처리
|
//로그인처리
|
||||||
protected function create_process(array $formDatas): UserEntity
|
protected function login_process(array $formDatas): UserEntity
|
||||||
{
|
{
|
||||||
if (!array_key_exists('access_code', $formDatas) || !$formDatas['access_code']) {
|
if (!array_key_exists('access_code', $formDatas) || !$formDatas['access_code']) {
|
||||||
throw new \Exception("구글 로그인 실패");
|
throw new \Exception("구글 로그인 실패");
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class LocalController extends AuthController
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
//로그인처리
|
//로그인처리
|
||||||
protected function create_process(array $formDatas): UserEntity
|
protected function login_process(array $formDatas): UserEntity
|
||||||
{
|
{
|
||||||
return $this->getService()->login($formDatas);
|
return $this->getService()->login($formDatas);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,6 @@ use Psr\Log\LoggerInterface;
|
|||||||
|
|
||||||
abstract class CommonController extends BaseController
|
abstract class CommonController extends BaseController
|
||||||
{
|
{
|
||||||
private $_db;
|
|
||||||
private $_myAuth = null;
|
private $_myAuth = null;
|
||||||
private ?MyLogService $_myLogService = null;
|
private ?MyLogService $_myLogService = null;
|
||||||
private $_viewDatas = [];
|
private $_viewDatas = [];
|
||||||
@ -38,7 +37,6 @@ abstract class CommonController extends BaseController
|
|||||||
$this->myAuthName = $this->getMyAuth()->getNameByAuthInfo();
|
$this->myAuthName = $this->getMyAuth()->getNameByAuthInfo();
|
||||||
$this->myAuthUID = $this->getMyAuth()->getUIDByAuthInfo();
|
$this->myAuthUID = $this->getMyAuth()->getUIDByAuthInfo();
|
||||||
}
|
}
|
||||||
$this->_db = \Config\Database::connect();
|
|
||||||
}
|
}
|
||||||
final public function __get($name)
|
final public function __get($name)
|
||||||
{
|
{
|
||||||
@ -95,81 +93,104 @@ abstract class CommonController extends BaseController
|
|||||||
}
|
}
|
||||||
return $this->_control['action'];
|
return $this->_control['action'];
|
||||||
}
|
}
|
||||||
final protected function initAction(array $actionFields): void
|
//FormFields정의
|
||||||
|
final protected function getFormFields($fields = []): array
|
||||||
{
|
{
|
||||||
//Fields 정의
|
return array_merge($fields, $this->getControlDatas('actionFields'));
|
||||||
$this->setControlDatas('actionFields', array_key_exists('fields', $actionFields) ? $actionFields['fields'] : []);
|
}
|
||||||
//Filters 정의
|
final protected function setFormFields(?array $fields = null): void
|
||||||
$this->setControlDatas('actionFilters', array_key_exists('filters', $actionFields) ? $actionFields['filters'] : []);
|
{
|
||||||
//Field Rule정의
|
switch ($this->getAction()) {
|
||||||
foreach ($this->getControlDatas('actionFields') as $field) {
|
case 'index':
|
||||||
$this->setFormFielRule($field, $this->getFormFieldRule_process($this->getAction(), $field));
|
$actionFields = $this->getService()->getIndexFields();
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$actionFields = $this->getService()->getViewFields();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$actionFields = $this->getService()->getFormFields();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
//Form용 Options정의
|
$this->setControlDatas('actionFields', is_array($fields) ? $fields : $actionFields);
|
||||||
foreach ($this->getControlDatas('actionFilters') as $field) {
|
}
|
||||||
$options = [];
|
final protected function getFormFilters($filters = []): array
|
||||||
foreach ($this->getFormFieldOption_process($field) as $entity) {
|
{
|
||||||
$options[$entity->getPK()] = $entity;
|
return array_merge($filters, $this->getControlDatas('actionFilters'));
|
||||||
}
|
}
|
||||||
$this->setFormFieldOptions($field, $options);
|
final protected function setFormFilters(?array $filters = null): void
|
||||||
|
{
|
||||||
|
switch ($this->getAction()) {
|
||||||
|
case 'index':
|
||||||
|
$actionFilters = $this->getService()->getIndexFilters();
|
||||||
|
break;
|
||||||
|
case 'view':
|
||||||
|
$actionFilters = $this->getService()->getViewFilters();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$actionFilters = $this->getService()->getFormFilters();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
//일괄작업용 Fields정의
|
$this->setControlDatas('actionFilters', is_array($filters) ? $filters : $actionFilters);
|
||||||
$this->setControlDatas(
|
|
||||||
'batchjob_fields',
|
|
||||||
array_key_exists('batchjob_fields', $actionFields) ? $actionFields['batchjob_fields'] : $this->getService()->getBatchjobFields()
|
|
||||||
);
|
|
||||||
//일괄작업용 버튼정의
|
|
||||||
$this->setControlDatas(
|
|
||||||
'batchjob_buttions',
|
|
||||||
array_key_exists('batchjob_buttions', $actionFields) ? $actionFields['batchjob_buttions'] : $this->getService()->getBatchjobButtons()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
//FormRules정의
|
//FormRules정의
|
||||||
final protected function setFormFielRule($field, string $rule)
|
final protected function getFormRules(array $rules = []): array
|
||||||
{
|
{
|
||||||
//기존 Filter Rules 가져와서 field에 해당하는 rule이 없으면 field를 filter_rules 전체 적용
|
foreach ($this->getControlDatas('field_rules') as $field => $rule) {
|
||||||
$allRules = $this->getControlDatas('field_rules') ?? [];
|
$rules[$field] = $rule;
|
||||||
$allRules[$field] = $rule;
|
}
|
||||||
$this->setControlDatas('field_rules', $allRules);
|
return $rules;
|
||||||
|
}
|
||||||
|
final protected function setFormRules(): void
|
||||||
|
{
|
||||||
|
$rules = [];
|
||||||
|
foreach ($this->getControlDatas('actionFields') as $field) {
|
||||||
|
$rules = $this->getFormRule($field, $rules);
|
||||||
|
}
|
||||||
|
$this->setControlDatas('field_rules', $rules);
|
||||||
}
|
}
|
||||||
//FormOptions정의
|
//FormOptions정의
|
||||||
final protected function setFormFieldOptions($field, array $options)
|
final protected function getFormOptions(array $options = []): array
|
||||||
|
{
|
||||||
|
foreach ($this->getControlDatas('field_optons') as $field => $option) {
|
||||||
|
$options[$field] = $option;
|
||||||
|
}
|
||||||
|
return $options;
|
||||||
|
}
|
||||||
|
final protected function setFormOptions(): void
|
||||||
{
|
{
|
||||||
//기존 Filter Options 가져와서 field에 해당하는 option이 없으면 field를 key로 배열추가 후 다시 filter_options 전체 적용
|
//기존 Filter Options 가져와서 field에 해당하는 option이 없으면 field를 key로 배열추가 후 다시 filter_options 전체 적용
|
||||||
$allOptions = $this->getControlDatas('filter_optons') ?? [];
|
$options = [];
|
||||||
$allOptions[$field] = $options;
|
foreach ($this->getControlDatas('actionFilters') as $field) {
|
||||||
$this->setControlDatas('filter_optons', $allOptions);
|
$options[$field] = $this->getFormOption($field, $options);
|
||||||
|
}
|
||||||
|
$this->setControlDatas('field_optons', $options);
|
||||||
}
|
}
|
||||||
//전체 FormDatas 전달값받기
|
//FormDatas 전달값,Default값
|
||||||
final protected function getFormDatas(array $fields, array $requestDatas, array $formDatas = []): array
|
final protected function getFormDatas($formDatas = []): array
|
||||||
{
|
{
|
||||||
foreach ($fields as $field) {
|
foreach ($this->getControlDatas('form_datas') as $field => $value) {
|
||||||
//Post값이 null이면 formDatas에서 해당하는 default값이 있는지 확인후 넣고,없으면 최종적으로 null
|
$formDatas[$field] = $value;
|
||||||
$datas = $requestDatas[$field] ?? null;
|
|
||||||
if ($datas !== null) {
|
|
||||||
$formDatas[$field] = $datas;
|
|
||||||
} else {
|
|
||||||
$formDatas = $this->getFormData_process($field, $requestDatas, $formDatas);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $formDatas;
|
return $formDatas;
|
||||||
}
|
}
|
||||||
final protected function setFieldDefaultValue(string $field, mixed $default): void
|
final protected function setFormDatas(array $requestDatas, array $formDatas = []): void
|
||||||
{
|
{
|
||||||
if (array_key_exists('field_default_values', $this->_control)) {
|
foreach ($this->getControlDatas('actionFields') as $field) {
|
||||||
$this->_control['field_default_values'] = [];
|
$formDatas = $this->getFormData($field, $requestDatas, $formDatas);
|
||||||
}
|
}
|
||||||
$this->_control['field_default_values'][$field] = $default;
|
// echo var_dump($requestDatas);
|
||||||
|
// dd($formDatas);
|
||||||
|
$this->setControlDatas('form_datas', $formDatas);
|
||||||
}
|
}
|
||||||
//FormDatas 검증
|
//FormDatas 검증
|
||||||
final protected function doValidation(array $formDatas): void
|
final protected function doValidations(): void
|
||||||
{
|
{
|
||||||
//변경할 값 확인 : Upload된 파일 검증시 $this->request->getPOST()보다 먼처 체크필요
|
//변경할 값 확인 : Upload된 파일 검증시 $this->request->getPOST()보다 먼처 체크필요
|
||||||
$validation = service('validation');
|
$validation = service('validation');
|
||||||
foreach ($this->getControlDatas('field_rules') as $field => $rule) {
|
foreach ($this->getControlDatas('field_rules') as $field => $rule) {
|
||||||
$validation = $this->doValidation_process($validation, $field, $rule);
|
$validation = $this->doValidation($validation, $field, $rule);
|
||||||
}
|
}
|
||||||
if (!$validation->run($formDatas)) {
|
if (!$validation->run($this->getFormDatas())) {
|
||||||
throw new \Exception("{$this->getService()->getClassName()} 작업 데이터 검증 오류발생\n" . implode(
|
throw new \Exception("{$this->getService()->getClassName()} 작업 데이터 검증 오류발생\n" . implode(
|
||||||
"\n",
|
"\n",
|
||||||
$validation->getErrors()
|
$validation->getErrors()
|
||||||
@ -177,309 +198,28 @@ abstract class CommonController extends BaseController
|
|||||||
}
|
}
|
||||||
// return $validation->getValidated();
|
// return $validation->getValidated();
|
||||||
}
|
}
|
||||||
//생성 기본기능
|
//공통 필수기능
|
||||||
final public function create_form(): RedirectResponse|string
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->initAction($this->getService()->getFormFields());
|
|
||||||
$this->create_form_process();
|
|
||||||
//actionFilters에 해당하는 값이 있을 경우 정의
|
|
||||||
helper(['form']);
|
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
|
||||||
return $this->getResultSuccess_process();
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $this->getResultFail_process($e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final public function create(): RedirectResponse|string
|
|
||||||
{
|
|
||||||
$this->_db->transStart();
|
|
||||||
try {
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->initAction($this->getService()->getFormFields());
|
|
||||||
//전달값받기
|
|
||||||
$formDatas = $this->getFormDatas($this->getControlDatas('actionFields'), $this->request->getPost());
|
|
||||||
$formDatas = $this->create_validate_process($formDatas);
|
|
||||||
$this->entity = $this->create_process($formDatas);
|
|
||||||
$this->_db->transCommit();
|
|
||||||
return $this->getResultSuccess_process();
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
$this->_db->transRollback();
|
|
||||||
return $this->getResultFail_process($e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//수정 기본기능
|
|
||||||
final public function modify_form(mixed $uid): RedirectResponse|string
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->initAction($this->getService()->getFormFields());
|
|
||||||
//기존 Entity 가져오기
|
|
||||||
$entity = $this->getService()->getEntity($uid);
|
|
||||||
if (!$entity) {
|
|
||||||
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
|
||||||
}
|
|
||||||
$this->entity = $this->modify_form_process($entity);
|
|
||||||
helper(['form']);
|
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
|
||||||
return $this->getResultSuccess_process();
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $this->getResultFail_process($e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final public function modify(int $uid): RedirectResponse|string
|
|
||||||
{
|
|
||||||
//Transaction Start
|
|
||||||
$this->_db->transStart();
|
|
||||||
try {
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->initAction($this->getService()->getFormFields());
|
|
||||||
//기존 Entity 가져오기
|
|
||||||
$entity = $this->getService()->getEntity($uid);
|
|
||||||
if (!$entity) {
|
|
||||||
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
|
||||||
}
|
|
||||||
//전달값받기
|
|
||||||
$formDatas = $this->getFormDatas($this->getControlDatas('actionFields'), $this->request->getPost());
|
|
||||||
$formDatas = $this->modify_validate_process($formDatas);
|
|
||||||
$this->entity = $this->modify_process($entity, $formDatas);
|
|
||||||
$this->_db->transCommit();
|
|
||||||
return $this->getResultSuccess_process();
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
$this->_db->transRollback();
|
|
||||||
return $this->getResultFail_process($e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//단일필드작업기능
|
|
||||||
final public function toggle(mixed $uid, string $field): RedirectResponse|string
|
|
||||||
{
|
|
||||||
//Transaction Start
|
|
||||||
$this->_db->transStart();
|
|
||||||
try {
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
|
||||||
//각 Field 초기화:조건항목 Field는 한개만 존재하므로 Field와 Rule을 정의
|
|
||||||
$this->initAction(['fields' => [$field], 'filters' => [$field]]);
|
|
||||||
//기존 Entity 가져오기
|
|
||||||
$entity = $this->getService()->getEntity($uid);
|
|
||||||
if (!$entity) {
|
|
||||||
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
|
||||||
}
|
|
||||||
//전달값받기
|
|
||||||
$formDatas = $this->getFormDatas($this->getControlDatas('actionFields'), $this->request->getVar());
|
|
||||||
$formDatas = $this->toggle_validate_process($formDatas);
|
|
||||||
// echo var_dump($this->getControlDatas());
|
|
||||||
// dd($formDatas);
|
|
||||||
$this->entity = $this->toggle_process($entity, $formDatas);
|
|
||||||
$this->_db->transCommit();
|
|
||||||
return $this->getResultSuccess_process();
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
$this->_db->transRollback();
|
|
||||||
return $this->getResultFail_process($e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//일괄처리작업기능
|
|
||||||
protected function batchjob_pre_process(): array
|
|
||||||
{
|
|
||||||
$selectedFields = [];
|
|
||||||
//getBatchJobFields를 이용해서 선택된 Field 와 값정의
|
|
||||||
$formDatas = [];
|
|
||||||
foreach ($this->getService()->getBatchjobFields() as $field) {
|
|
||||||
$value = $this->request->getPost($field);
|
|
||||||
if ($value) {
|
|
||||||
$selectedFields[] = $field;
|
|
||||||
$formDatas[$field] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!count($selectedFields)) {
|
|
||||||
throw new \Exception("변경할 조건항목을 선택하셔야합니다.");
|
|
||||||
}
|
|
||||||
//변경할 UIDS 정의
|
|
||||||
$uids = $this->request->getPost('batchjob_uids[]');
|
|
||||||
if (!is_array($uids) || !count($uids)) {
|
|
||||||
throw new \Exception("적용할 리스트을 선택하셔야합니다.");
|
|
||||||
}
|
|
||||||
return [$selectedFields, $formDatas, $uids];
|
|
||||||
}
|
|
||||||
final public function batchjob(): RedirectResponse|string
|
|
||||||
{
|
|
||||||
//Transaction Start
|
|
||||||
$this->_db->transStart();
|
|
||||||
try {
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
|
||||||
list($selectedFields, $formDatas, $uids) = $this->batchjob_pre_process();
|
|
||||||
//각 Field 초기화:조건항목 Field와 Rule을 정의
|
|
||||||
$this->initAction(['fields' => $selectedFields, 'filters' => $selectedFields]);
|
|
||||||
//전달값받기
|
|
||||||
$formDatas = $this->getFormDatas($this->getControlDatas('actionFields'), $this->request->getPost());
|
|
||||||
$formDatas = $this->batchjob_validate_process($formDatas);
|
|
||||||
$entities = [];
|
|
||||||
foreach ($uids as $uid) {
|
|
||||||
//기존 Entity 가져오기
|
|
||||||
$entity = $this->getService()->getEntity($uid);
|
|
||||||
if (!$entity) {
|
|
||||||
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
|
||||||
}
|
|
||||||
$entities[] = $this->batchjob_process($entity, $formDatas);
|
|
||||||
}
|
|
||||||
$this->entities = $entities;
|
|
||||||
$this->_db->transCommit();
|
|
||||||
LogCollector::debug(sprintf("%s에서 총 %s개중 %s개 일괄작업을 완료하였습니다.", __METHOD__, count($uids), count($this->entities)));
|
|
||||||
return $this->getResultSuccess_process();
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
$this->_db->transRollback();
|
|
||||||
return $this->getResultFail_process($e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final public function delete(mixed $uid): RedirectResponse|string
|
|
||||||
{
|
|
||||||
//Transaction Start
|
|
||||||
$this->_db->transStart();
|
|
||||||
try {
|
|
||||||
//Action 정의:삭제는 다른 초기화 필요없음
|
|
||||||
$this->setAction(__FUNCTION__);
|
|
||||||
//기존 Entity 가져오기
|
|
||||||
$entity = $this->getService()->getEntity($uid);
|
|
||||||
if (!$entity) {
|
|
||||||
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
|
||||||
}
|
|
||||||
$this->delete_process($entity);
|
|
||||||
$this->_db->transCommit();
|
|
||||||
return $this->getResultSuccess_process();
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
$this->_db->transRollback();
|
|
||||||
return $this->getResultFail_process($e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//일괄삭제
|
|
||||||
final public function batchjob_delete(): RedirectResponse|string
|
|
||||||
{
|
|
||||||
//Transaction Start
|
|
||||||
$this->_db->transStart();
|
|
||||||
try {
|
|
||||||
//Action 정의:삭제는 다른 초기화 필요없음
|
|
||||||
$this->setAction(__FUNCTION__);
|
|
||||||
//변경할 UIDS
|
|
||||||
$uids = $this->request->getPost('batchjob_uids[]');
|
|
||||||
if (!is_array($uids) || !count($uids)) {
|
|
||||||
throw new \Exception("적용할 리스트를 선택하셔야합니다.");
|
|
||||||
}
|
|
||||||
$entities = [];
|
|
||||||
foreach ($uids as $uid) {
|
|
||||||
//기존 Entity 가져오기
|
|
||||||
$entity = $this->getService()->getEntity($uid);
|
|
||||||
if (!$entity) {
|
|
||||||
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
|
||||||
}
|
|
||||||
$entities[] = $this->batchjob_delete_process($entity);
|
|
||||||
}
|
|
||||||
$this->entities = $entities;
|
|
||||||
$this->_db->transCommit();
|
|
||||||
LogCollector::debug(sprintf("%s에서 총 %s개중 %s개 일괄삭제를 완료하였습니다.", __METHOD__, count($uids), count($this->entities)));
|
|
||||||
return $this->getResultSuccess_process();
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
$this->_db->transRollback();
|
|
||||||
return $this->getResultFail_process($e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final public function view(string $uid): RedirectResponse|string
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
//Action 정의
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->initAction($this->getService()->getViewFields());
|
|
||||||
//기존 Entity 가져오기
|
|
||||||
$entity = $this->getService()->getEntity($uid);
|
|
||||||
if (!$entity) {
|
|
||||||
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
|
||||||
}
|
|
||||||
$this->entity = $this->view_process($entity);
|
|
||||||
helper(['form']);
|
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
|
||||||
return $this->getResultSuccess_process();
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $this->getResultFail_process($e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//OUPUT Document 관련
|
|
||||||
private function download_document(string $document_type, mixed $loaded_data): array
|
|
||||||
{
|
|
||||||
$full_path = WRITEPATH . DIRECTORY_SEPARATOR . "excel";
|
|
||||||
switch ($document_type) {
|
|
||||||
case 'excel':
|
|
||||||
$file_name = sprintf("%s_%s.xlsx", $this->getService()->getClassName(), date('Y-m-d_Hm'));
|
|
||||||
$writer = IOFactory::createWriter($loaded_data, 'Xlsx');
|
|
||||||
$writer->save($full_path . DIRECTORY_SEPARATOR . $file_name);
|
|
||||||
break;
|
|
||||||
case 'pdf':
|
|
||||||
$file_name = sprintf("%s_%s.pdf", $this->getService()->getClassName(), date('Y-m-d_Hm'));
|
|
||||||
$writer = new Mpdf($loaded_data);
|
|
||||||
$writer->save($full_path . DIRECTORY_SEPARATOR . $file_name);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return array($full_path, $file_name);
|
|
||||||
}
|
|
||||||
// Download
|
|
||||||
final public function download(string $output_type, mixed $uid = false): DownloadResponse|RedirectResponse|string
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
|
||||||
//각 Field 초기화
|
|
||||||
$this->initAction($this->getService()->getIndexFields());
|
|
||||||
//URL처리
|
|
||||||
// $this->uri = $this->request->getUri();
|
|
||||||
switch ($output_type) {
|
|
||||||
case 'excel':
|
|
||||||
case 'pdf':
|
|
||||||
helper(['form']);
|
|
||||||
$this->index_process();
|
|
||||||
$html = $this->getResultSuccess_process();
|
|
||||||
//data loading
|
|
||||||
$reader = new Html();
|
|
||||||
$loaded_data = $reader->loadFromString($html);
|
|
||||||
list($full_path, $file_name) = $this->download_document($output_type, $loaded_data);
|
|
||||||
$full_path .= DIRECTORY_SEPARATOR . $file_name;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (!$uid) {
|
|
||||||
throw new \Exception("{$output_type}은 반드시 uid의 값이 필요합니다.");
|
|
||||||
}
|
|
||||||
$entity = $this->getService()->getEntity($uid);
|
|
||||||
if (!$entity) {
|
|
||||||
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
|
||||||
}
|
|
||||||
$this->entity = $entity;
|
|
||||||
list($file_name, $uploaded_filename) = $entity->getDownlaodFile();
|
|
||||||
$full_path = WRITEPATH . DIRECTORY_SEPARATOR . "uploads" . DIRECTORY_SEPARATOR . $uploaded_filename;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $this->response->download($full_path, null)->setFileName($file_name);
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return $this->getResultFail_process($e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//공통 기본 기능
|
|
||||||
|
|
||||||
//추가 개별 처리 기능
|
|
||||||
//FieldForm관련용
|
//FieldForm관련용
|
||||||
protected function getFormFieldOption_process(string $field, array $options = []): array
|
protected function getFormRule(string $field, array $rules = []): array
|
||||||
|
{
|
||||||
|
if (is_array($field)) {
|
||||||
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
|
}
|
||||||
|
switch ($field) {
|
||||||
|
default:
|
||||||
|
$rules[$field] = $this->getService()->getFormRule($this->getAction(), $field);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!is_array($rules)) {
|
||||||
|
throw new \Exception(__FUNCTION__ . "에서 {$field}의 Rules 값이 array가 아닙니다.\n" . var_export($rules, true));
|
||||||
|
}
|
||||||
|
return $rules;
|
||||||
|
}
|
||||||
|
protected function getFormOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
$options = $this->getService()->getFormFieldOption($field, $options);
|
$options = $this->getService()->getFormOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!is_array($options)) {
|
if (!is_array($options)) {
|
||||||
@ -487,24 +227,17 @@ abstract class CommonController extends BaseController
|
|||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
protected function getFormFieldRule_process(string $action, string $field): string
|
//FormData Field별 전달값 처리
|
||||||
|
protected function getFormData(string $field, array $requestDatas, array $formDatas): array
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
|
||||||
}
|
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
$rule = $this->getService()->getFormFieldRule($action, $field);
|
$formDatas[$field] = $requestDatas[$field] ?? null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
|
||||||
}
|
|
||||||
//FormData Field별 전달값 처리
|
|
||||||
protected function getFormData_process(string $field, array $requestDatas, array $formDatas): array
|
|
||||||
{
|
|
||||||
return $formDatas;
|
return $formDatas;
|
||||||
}
|
}
|
||||||
protected function doValidation_process(Validation $validation, string $field, string $rule): Validation
|
protected function doValidation(Validation $validation, string $field, string $rule): Validation
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
@ -514,7 +247,7 @@ abstract class CommonController extends BaseController
|
|||||||
return $validation;
|
return $validation;
|
||||||
}
|
}
|
||||||
//Process Result처리
|
//Process Result처리
|
||||||
protected function getResultFail_process(string $message = MESSAGES["FAILED"]): RedirectResponse
|
protected function getResultFail(string $message = MESSAGES["FAILED"]): RedirectResponse
|
||||||
{
|
{
|
||||||
LogCollector::debug($message);
|
LogCollector::debug($message);
|
||||||
$this->getMyLogService()->save($this->getService()->getClassName(), $this->getAction(), $message, $this->getMyAuth()->getUIDByAuthInfo());
|
$this->getMyLogService()->save($this->getService()->getClassName(), $this->getAction(), $message, $this->getMyAuth()->getUIDByAuthInfo());
|
||||||
@ -523,7 +256,7 @@ abstract class CommonController extends BaseController
|
|||||||
}
|
}
|
||||||
return redirect()->to($this->getMyAuth()->popPreviousUrl())->with('error', $message);
|
return redirect()->to($this->getMyAuth()->popPreviousUrl())->with('error', $message);
|
||||||
}
|
}
|
||||||
protected function getResultSuccess_process(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
||||||
{
|
{
|
||||||
helper(['form']);
|
helper(['form']);
|
||||||
switch ($this->getControlDatas('action')) {
|
switch ($this->getControlDatas('action')) {
|
||||||
@ -555,90 +288,294 @@ abstract class CommonController extends BaseController
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
//Index,FieldForm관련
|
//Index,FieldForm관련
|
||||||
//생성관련
|
//생성 기본기능
|
||||||
protected function create_form_process(): void {}
|
protected function create_form_process(): void {}
|
||||||
protected function create_validate_process(array $formDatas): array
|
public function create_form(): RedirectResponse|string
|
||||||
{
|
{
|
||||||
$this->doValidation($formDatas);
|
try {
|
||||||
return $formDatas;
|
$this->setAction(__FUNCTION__);
|
||||||
|
$this->setFormFields();
|
||||||
|
$this->setFormFilters();
|
||||||
|
$this->setFormRules();
|
||||||
|
$this->setFormOptions();
|
||||||
|
//기본값정의
|
||||||
|
$this->setFormDatas($this->request->getGet());
|
||||||
|
$this->create_form_process();
|
||||||
|
helper(['form']);
|
||||||
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
|
return $this->getResultSuccess();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
// dd($e->getMessage());
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
protected function create_process(array $formDatas): mixed
|
protected function create_process(array $formDatas): mixed
|
||||||
{
|
{
|
||||||
return $this->getService()->create($formDatas);
|
return $this->getService()->create($formDatas);
|
||||||
}
|
}
|
||||||
//수정관련
|
public function create(): RedirectResponse|string
|
||||||
|
{
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
$db->transStart();
|
||||||
|
try {
|
||||||
|
$this->setAction(__FUNCTION__);
|
||||||
|
$this->setFormFields();
|
||||||
|
$this->setFormFilters();
|
||||||
|
$this->setFormRules();
|
||||||
|
//전달값정의
|
||||||
|
$this->setFormDatas($this->request->getPost());
|
||||||
|
$this->doValidations();
|
||||||
|
$this->entity = $this->create_process($this->getFormDatas());
|
||||||
|
$db->transCommit();
|
||||||
|
return $this->getResultSuccess();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$db->transRollback();
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//수정 기본기능
|
||||||
protected function modify_form_process(mixed $entity): mixed
|
protected function modify_form_process(mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return $entity;
|
return $entity;
|
||||||
}
|
}
|
||||||
protected function modify_validate_process(array $formDatas): array
|
public function modify_form(mixed $uid): RedirectResponse|string
|
||||||
{
|
{
|
||||||
$this->doValidation($formDatas);
|
try {
|
||||||
return $formDatas;
|
$this->setAction(__FUNCTION__);
|
||||||
|
$this->setFormFields();
|
||||||
|
$this->setFormFilters();
|
||||||
|
$this->setFormRules();
|
||||||
|
$this->setFormOptions();
|
||||||
|
//기본값정의
|
||||||
|
$this->setFormDatas($this->request->getGet());
|
||||||
|
//기존 Entity 가져오기
|
||||||
|
$entity = $this->getService()->getEntity($uid);
|
||||||
|
if (!$entity) {
|
||||||
|
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
$this->entity = $this->modify_form_process($uid);
|
||||||
|
helper(['form']);
|
||||||
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
|
return $this->getResultSuccess();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
protected function modify_process(mixed $entity, array $formDatas): mixed
|
protected function modify_process(mixed $entity, array $formDatas): mixed
|
||||||
{
|
{
|
||||||
return $this->getService()->modify($entity, $formDatas);
|
return $this->getService()->modify($entity, $formDatas);
|
||||||
}
|
}
|
||||||
//단일필드작업기능
|
public function modify(int $uid): RedirectResponse|string
|
||||||
protected function toggle_validate_process(array $formDatas): array
|
|
||||||
{
|
{
|
||||||
$this->doValidation($formDatas);
|
//Transaction Start
|
||||||
return $formDatas;
|
$db = \Config\Database::connect();
|
||||||
|
$db->transStart();
|
||||||
|
try {
|
||||||
|
$this->setAction(__FUNCTION__);
|
||||||
|
$this->setFormFields();
|
||||||
|
$this->setFormFilters();
|
||||||
|
$this->setFormRules();
|
||||||
|
//전달값정의
|
||||||
|
$this->setFormDatas($this->request->getPost());
|
||||||
|
$this->doValidations();
|
||||||
|
//기존 Entity 가져오기
|
||||||
|
$entity = $this->getService()->getEntity($uid);
|
||||||
|
if (!$entity) {
|
||||||
|
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
$this->entity = $this->modify_process($entity, $this->getFormDatas());
|
||||||
|
$db->transCommit();
|
||||||
|
return $this->getResultSuccess();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$db->transRollback();
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
//단일필드작업기능
|
||||||
protected function toggle_process(mixed $entity, array $formDatas): mixed
|
protected function toggle_process(mixed $entity, array $formDatas): mixed
|
||||||
{
|
{
|
||||||
return $this->getService()->modify($entity, $formDatas);
|
return $this->getService()->modify($entity, $formDatas);
|
||||||
}
|
}
|
||||||
//일괄처리작업기능
|
public function toggle(mixed $uid, string $field): RedirectResponse|string
|
||||||
protected function batchjob_validate_process(array $formDatas): array
|
|
||||||
{
|
{
|
||||||
$this->doValidation($formDatas);
|
//Transaction Start
|
||||||
return $formDatas;
|
$db = \Config\Database::connect();
|
||||||
|
$db->transStart();
|
||||||
|
try {
|
||||||
|
$this->setAction(__FUNCTION__);
|
||||||
|
$this->setFormFields([$field]);
|
||||||
|
$this->setFormFilters([$field]);
|
||||||
|
$this->setFormRules();
|
||||||
|
//기본값정의
|
||||||
|
$this->setFormDatas($this->request->getGet());
|
||||||
|
//기존 Entity 가져오기
|
||||||
|
$entity = $this->getService()->getEntity($uid);
|
||||||
|
if (!$entity) {
|
||||||
|
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
$this->entity = $this->toggle_process($entity, $this->getFormDatas());
|
||||||
|
$db->transCommit();
|
||||||
|
return $this->getResultSuccess();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$db->transRollback();
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
protected function batchjob_process($entity, array $formDatas): mixed
|
//일괄처리작업기능
|
||||||
|
protected function batchjob_process(mixed $entity, array $formDatas): mixed
|
||||||
{
|
{
|
||||||
return $this->getService()->modify($entity, $formDatas);
|
return $this->getService()->modify($entity, $formDatas);
|
||||||
}
|
}
|
||||||
|
protected function batchjob_pre_process(): array
|
||||||
|
{
|
||||||
|
$selectedFields = [];
|
||||||
|
//getBatchJobFields를 이용해서 선택된 Field 와 값정의
|
||||||
|
$formDatas = [];
|
||||||
|
foreach ($this->getService()->getBatchjobFields() as $field) {
|
||||||
|
$value = $this->request->getPost($field);
|
||||||
|
if ($value) {
|
||||||
|
$selectedFields[] = $field;
|
||||||
|
$formDatas[$field] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!count($selectedFields)) {
|
||||||
|
throw new \Exception("변경할 조건항목을 선택하셔야합니다.");
|
||||||
|
}
|
||||||
|
//변경할 UIDS 정의
|
||||||
|
$uids = $this->request->getPost('batchjob_uids[]');
|
||||||
|
if (!is_array($uids) || !count($uids)) {
|
||||||
|
throw new \Exception("적용할 리스트을 선택하셔야합니다.");
|
||||||
|
}
|
||||||
|
return [$selectedFields, $formDatas, $uids];
|
||||||
|
}
|
||||||
|
public function batchjob(): RedirectResponse|string
|
||||||
|
{
|
||||||
|
//Transaction Start
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
$db->transStart();
|
||||||
|
try {
|
||||||
|
$this->setAction(__FUNCTION__);
|
||||||
|
list($selectedFields, $formDatas, $uids) = $this->batchjob_pre_process();
|
||||||
|
$this->setFormFields($selectedFields);
|
||||||
|
$this->setFormFilters($selectedFields);
|
||||||
|
$this->setFormRules();
|
||||||
|
//기본값정의
|
||||||
|
$this->setFormDatas($this->request->getGet());
|
||||||
|
$entities = [];
|
||||||
|
foreach ($uids as $uid) {
|
||||||
|
//기존 Entity 가져오기
|
||||||
|
$entity = $this->getService()->getEntity($uid);
|
||||||
|
if (!$entity) {
|
||||||
|
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
$entities[] = $this->batchjob_process($entity, $formDatas);
|
||||||
|
}
|
||||||
|
$this->entities = $entities;
|
||||||
|
$db->transCommit();
|
||||||
|
LogCollector::debug(sprintf("%s에서 총 %s개중 %s개 일괄작업을 완료하였습니다.", __METHOD__, count($uids), count($this->entities)));
|
||||||
|
return $this->getResultSuccess();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$db->transRollback();
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
//삭제관련
|
//삭제관련
|
||||||
protected function delete_process(mixed $entity): mixed
|
protected function delete_process(mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return $this->getService()->delete($entity);
|
return $this->getService()->delete($entity);
|
||||||
}
|
}
|
||||||
|
public function delete(mixed $uid): RedirectResponse|string
|
||||||
|
{
|
||||||
|
//Transaction Start
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
$db->transStart();
|
||||||
|
try {
|
||||||
|
$this->setAction(__FUNCTION__);
|
||||||
|
//기존 Entity 가져오기
|
||||||
|
$entity = $this->getService()->getEntity($uid);
|
||||||
|
if (!$entity) {
|
||||||
|
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
$this->delete_process($entity);
|
||||||
|
$db->transCommit();
|
||||||
|
return $this->getResultSuccess();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$db->transRollback();
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
//일괄삭제관련
|
//일괄삭제관련
|
||||||
protected function batchjob_delete_process(mixed $entity, array $entities = []): mixed
|
protected function batchjob_delete_process(mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return $this->getService()->delete($entity);
|
return $this->getService()->delete($entity);
|
||||||
}
|
}
|
||||||
|
protected function batchjob_delete_pre_process(): array
|
||||||
|
{
|
||||||
|
//변경할 UIDS
|
||||||
|
$uids = $this->request->getPost('batchjob_uids[]');
|
||||||
|
if (!is_array($uids) || !count($uids)) {
|
||||||
|
throw new \Exception("적용할 리스트를 선택하셔야합니다.");
|
||||||
|
}
|
||||||
|
return $uids;
|
||||||
|
}
|
||||||
|
public function batchjob_delete(): RedirectResponse|string
|
||||||
|
{
|
||||||
|
//Transaction Start
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
$db->transStart();
|
||||||
|
try {
|
||||||
|
$this->setAction(__FUNCTION__);
|
||||||
|
$uids = $this->batchjob_delete_pre_process();
|
||||||
|
$entities = [];
|
||||||
|
foreach ($uids as $uid) {
|
||||||
|
//기존 Entity 가져오기
|
||||||
|
$entity = $this->getService()->getEntity($uid);
|
||||||
|
if (!$entity) {
|
||||||
|
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
$entities[] = $this->batchjob_delete_process($entity);
|
||||||
|
}
|
||||||
|
$this->entities = $entities;
|
||||||
|
$db->transCommit();
|
||||||
|
LogCollector::debug(sprintf("%s에서 총 %s개중 %s개 일괄삭제를 완료하였습니다.", __METHOD__, count($uids), count($this->entities)));
|
||||||
|
return $this->getResultSuccess();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$db->transRollback();
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
//View 관련
|
//View 관련
|
||||||
protected function view_process(mixed $entity): mixed
|
protected function view_process(mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return $entity;
|
return $entity;
|
||||||
}
|
}
|
||||||
|
public function view(string $uid): RedirectResponse|string
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$this->setAction(__FUNCTION__);
|
||||||
|
$this->setFormFields();
|
||||||
|
$this->setFormFilters();
|
||||||
|
$this->setFormRules();
|
||||||
|
$this->setFormOptions();
|
||||||
|
//기본값정의
|
||||||
|
$this->setFormDatas($this->request->getGet());
|
||||||
|
//기존 Entity 가져오기
|
||||||
|
$entity = $this->getService()->getEntity($uid);
|
||||||
|
if (!$entity) {
|
||||||
|
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
$this->entity = $this->view_process($entity);
|
||||||
|
helper(['form']);
|
||||||
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
|
return $this->getResultSuccess();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
//리스트관련
|
//리스트관련
|
||||||
//조건절 처리
|
//조건절 처리
|
||||||
//Filter Field별 전달값 처리
|
|
||||||
protected function index_condition_filterfield_process(string $field, $filter_values = []): array
|
|
||||||
{
|
|
||||||
switch ($field) {
|
|
||||||
default:
|
|
||||||
$filter_value = $this->request->getVar($field);
|
|
||||||
if ($filter_value !== null && $filter_value !== '') {
|
|
||||||
$this->getService()->index_condition_filterField($field, $filter_value);
|
|
||||||
$filter_values[$field] = $filter_value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $filter_values;
|
|
||||||
}
|
|
||||||
protected function index_condition_process(): void
|
protected function index_condition_process(): void
|
||||||
{
|
{
|
||||||
//Paramter로 전달된 Filter값을 정의용
|
|
||||||
$filter_values = [];
|
|
||||||
foreach ($this->getControlDatas('actionFilters') as $field) {
|
|
||||||
$filter_values = $this->index_condition_filterfield_process($field, $filter_values);
|
|
||||||
}
|
|
||||||
$this->setControlDatas('filter_values', $filter_values);
|
|
||||||
//검색어조건절 처리
|
//검색어조건절 처리
|
||||||
$this->word = $this->request->getVar('word');
|
$this->word = $this->request->getVar('word');
|
||||||
if ($this->word !== null && $this->word !== '') {
|
if ($this->word !== null && $this->word !== '') {
|
||||||
@ -687,10 +624,17 @@ abstract class CommonController extends BaseController
|
|||||||
public function index(): RedirectResponse|string
|
public function index(): RedirectResponse|string
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
//각 Field 초기화
|
|
||||||
$this->setAction(__FUNCTION__);
|
$this->setAction(__FUNCTION__);
|
||||||
//각 Field 초기화
|
$this->setFormFields();
|
||||||
$this->initAction($this->getService()->getIndexFields());
|
$this->setFormFilters();
|
||||||
|
$this->setFormRules();
|
||||||
|
//기본값정의
|
||||||
|
$this->setFormDatas($this->request->getGet());
|
||||||
|
$this->setFormOptions();
|
||||||
|
//일괄작업용 Fields정의
|
||||||
|
$this->setControlDatas('batchjob_fields', $this->getService()->getBatchjobFields());
|
||||||
|
//일괄작업용 버튼정의
|
||||||
|
$this->setControlDatas('batchjob_buttions', $this->getService()->getBatchjobButtons());
|
||||||
helper(['form']);
|
helper(['form']);
|
||||||
//Return Url정의
|
//Return Url정의
|
||||||
$this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
|
$this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
|
||||||
@ -711,10 +655,69 @@ abstract class CommonController extends BaseController
|
|||||||
$this->getService()->setOffset(($this->page - 1) * $this->per_page);
|
$this->getService()->setOffset(($this->page - 1) * $this->per_page);
|
||||||
$this->index_condition_process();
|
$this->index_condition_process();
|
||||||
$this->entities = $this->index_process();
|
$this->entities = $this->index_process();
|
||||||
return $this->getResultSuccess_process();
|
return $this->getResultSuccess();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $e->getMessage();
|
return $e->getMessage();
|
||||||
// return $this->getResultFail_process($e->getMessage());
|
// return $this->getResultFail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//OUPUT Document 관련
|
||||||
|
private function download_process(string $document_type, mixed $loaded_data): array
|
||||||
|
{
|
||||||
|
$full_path = WRITEPATH . DIRECTORY_SEPARATOR . "excel";
|
||||||
|
switch ($document_type) {
|
||||||
|
case 'excel':
|
||||||
|
$file_name = sprintf("%s_%s.xlsx", $this->getService()->getClassName(), date('Y-m-d_Hm'));
|
||||||
|
$writer = IOFactory::createWriter($loaded_data, 'Xlsx');
|
||||||
|
$writer->save($full_path . DIRECTORY_SEPARATOR . $file_name);
|
||||||
|
break;
|
||||||
|
case 'pdf':
|
||||||
|
$file_name = sprintf("%s_%s.pdf", $this->getService()->getClassName(), date('Y-m-d_Hm'));
|
||||||
|
$writer = new Mpdf($loaded_data);
|
||||||
|
$writer->save($full_path . DIRECTORY_SEPARATOR . $file_name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return array($full_path, $file_name);
|
||||||
|
}
|
||||||
|
// Download
|
||||||
|
public function download(string $output_type, mixed $uid = false): DownloadResponse|RedirectResponse|string
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$this->setAction(__FUNCTION__);
|
||||||
|
$this->setFormFields();
|
||||||
|
$this->setFormFilters();
|
||||||
|
$this->setFormRules();
|
||||||
|
$this->setFormOptions();
|
||||||
|
//URL처리
|
||||||
|
// $this->uri = $this->request->getUri();
|
||||||
|
switch ($output_type) {
|
||||||
|
case 'excel':
|
||||||
|
case 'pdf':
|
||||||
|
helper(['form']);
|
||||||
|
$this->index_process();
|
||||||
|
$html = $this->getResultSuccess();
|
||||||
|
//data loading
|
||||||
|
$reader = new Html();
|
||||||
|
$loaded_data = $reader->loadFromString($html);
|
||||||
|
list($full_path, $file_name) = $this->download_process($output_type, $loaded_data);
|
||||||
|
$full_path .= DIRECTORY_SEPARATOR . $file_name;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (!$uid) {
|
||||||
|
throw new \Exception("{$output_type}은 반드시 uid의 값이 필요합니다.");
|
||||||
|
}
|
||||||
|
$entity = $this->getService()->getEntity($uid);
|
||||||
|
if (!$entity) {
|
||||||
|
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
$this->entity = $entity;
|
||||||
|
list($file_name, $uploaded_filename) = $entity->getDownlaodFile();
|
||||||
|
$full_path = WRITEPATH . DIRECTORY_SEPARATOR . "uploads" . DIRECTORY_SEPARATOR . $uploaded_filename;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $this->response->download($full_path, null)->setFileName($file_name);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->getResultFail($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -217,13 +217,13 @@ class CommonHelper
|
|||||||
$extra .= sprintf(" %s=\"%s\"", $extra_tag, htmlspecialchars($extra_value, ENT_QUOTES, 'UTF-8'));
|
$extra .= sprintf(" %s=\"%s\"", $extra_tag, htmlspecialchars($extra_value, ENT_QUOTES, 'UTF-8'));
|
||||||
}
|
}
|
||||||
// 필터 옵션이 없으면 빈 배열로 초기화
|
// 필터 옵션이 없으면 빈 배열로 초기화
|
||||||
if (!array_key_exists($field, $viewDatas['control']['filter_optons'])) {
|
if (!array_key_exists($field, $viewDatas['control']['field_optons'])) {
|
||||||
return $field; // 필터 옵션이 없으면 빈 문자열 반환
|
return $field; // 필터 옵션이 없으면 빈 문자열 반환
|
||||||
}
|
}
|
||||||
// $formOptions는 필터 옵션 배열로, key는 필터 엔티티의 PK, value는 필터 엔티티 객체
|
// $formOptions는 필터 옵션 배열로, key는 필터 엔티티의 PK, value는 필터 엔티티 객체
|
||||||
$html = sprintf("<select name=\"%s\" %s>", $field, $extra);
|
$html = sprintf("<select name=\"%s\" %s>", $field, $extra);
|
||||||
$html .= "<option value=\"\">" . lang("{$viewDatas['class_path']}.label.{$field}") . " 선택" . "</option>";
|
$html .= "<option value=\"\">" . lang("{$viewDatas['class_path']}.label.{$field}") . " 선택" . "</option>";
|
||||||
foreach ($viewDatas['control']['filter_optons'][$field] as $key => $entity) {
|
foreach ($viewDatas['control']['field_optons'][$field] as $key => $entity) {
|
||||||
$isSelected = $key == $value ? ' selected' : '';
|
$isSelected = $key == $value ? ' selected' : '';
|
||||||
$isDisabled = $entity->getStatus() === $entity::DEFAULT_STATUS ? '' : ' disabled';
|
$isDisabled = $entity->getStatus() === $entity::DEFAULT_STATUS ? '' : ' disabled';
|
||||||
$html .= sprintf("<option value=\"%s\"%s%s>%s</option>", $key, $isSelected, $isDisabled, array_key_exists('isForm', $extras) ? $entity->getFormTitle() : $entity->getTitle());
|
$html .= sprintf("<option value=\"%s\"%s%s>%s</option>", $key, $isSelected, $isDisabled, array_key_exists('isForm', $extras) ? $entity->getFormTitle() : $entity->getTitle());
|
||||||
@ -242,13 +242,13 @@ class CommonHelper
|
|||||||
$form = form_input($field, $value ?? "", ["placeholder" => "예)010-0010-0010", ...$extras]);
|
$form = form_input($field, $value ?? "", ["placeholder" => "예)010-0010-0010", ...$extras]);
|
||||||
break;
|
break;
|
||||||
case 'role':
|
case 'role':
|
||||||
if (!is_array($viewDatas['control']['filter_optons'][$field])) {
|
if (!is_array($viewDatas['control']['field_optons'][$field])) {
|
||||||
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다.");
|
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다.");
|
||||||
}
|
}
|
||||||
// create, modify, create_form, modify_form일때 checkbox로 표시
|
// create, modify, create_form, modify_form일때 checkbox로 표시
|
||||||
if (in_array($viewDatas['control']['action'], ['create_form', 'modify_form'])) {
|
if (in_array($viewDatas['control']['action'], ['create_form', 'modify_form'])) {
|
||||||
$forms = [];
|
$forms = [];
|
||||||
foreach ($viewDatas['control']['filter_optons'][$field] as $key => $filterEntity) {
|
foreach ($viewDatas['control']['field_optons'][$field] as $key => $filterEntity) {
|
||||||
if ($key !== '') { // 빈값은 제외
|
if ($key !== '') { // 빈값은 제외
|
||||||
$values = is_array($value) ? $value : explode(DEFAULTS["DELIMITER_ROLE"], $value);
|
$values = is_array($value) ? $value : explode(DEFAULTS["DELIMITER_ROLE"], $value);
|
||||||
//form_check에는 "class" => "form-control" 쓰면 않되거나 form-check를 써야함
|
//form_check에는 "class" => "form-control" 쓰면 않되거나 form-check를 써야함
|
||||||
@ -298,12 +298,12 @@ class CommonHelper
|
|||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'user_uid':
|
case 'user_uid':
|
||||||
$value = array_key_exists($value, $viewDatas['control']['filter_optons'][$field]) && $viewDatas['control']['filter_optons'][$field][$value] ? $viewDatas['control']['filter_optons'][$field][$value]->getTitle() : "";
|
$value = array_key_exists($value, $viewDatas['control']['field_optons'][$field]) && $viewDatas['control']['field_optons'][$field][$value] ? $viewDatas['control']['field_optons'][$field][$value]->getTitle() : "";
|
||||||
break;
|
break;
|
||||||
case 'role':
|
case 'role':
|
||||||
$roles = [];
|
$roles = [];
|
||||||
foreach (explode(DEFAULTS["DELIMITER_ROLE"], $value) as $key) {
|
foreach (explode(DEFAULTS["DELIMITER_ROLE"], $value) as $key) {
|
||||||
$roles[] = $viewDatas['control']['filter_optons'][$field][$key]->getTitle() ?? "";
|
$roles[] = $viewDatas['control']['field_optons'][$field][$key]->getTitle() ?? "";
|
||||||
}
|
}
|
||||||
$value = implode(" , ", $roles);
|
$value = implode(" , ", $roles);
|
||||||
break;
|
break;
|
||||||
@ -334,7 +334,7 @@ class CommonHelper
|
|||||||
);
|
);
|
||||||
$value = $this->getFieldForm($field, $value, $viewDatas, $extras);
|
$value = $this->getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
} else {
|
} else {
|
||||||
$value = array_key_exists($value, $viewDatas['control']['filter_optons'][$field]) ? $viewDatas['control']['filter_optons'][$field][$value]->getTitle() : "";
|
$value = array_key_exists($value, $viewDatas['control']['field_optons'][$field]) ? $viewDatas['control']['field_optons'][$field][$value]->getTitle() : "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -347,14 +347,14 @@ class CommonHelper
|
|||||||
}
|
}
|
||||||
public function getListFilter(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
public function getListFilter(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
{
|
{
|
||||||
if (!array_key_exists($field, $viewDatas['control']['filter_optons'])) {
|
if (!array_key_exists($field, $viewDatas['control']['field_optons'])) {
|
||||||
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 정의되지 않았습니다.");
|
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 정의되지 않았습니다.");
|
||||||
}
|
}
|
||||||
if (!is_array($viewDatas['control']['filter_optons'][$field])) {
|
if (!is_array($viewDatas['control']['field_optons'][$field])) {
|
||||||
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다.");
|
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다.");
|
||||||
}
|
}
|
||||||
$options = ["" => lang("{$viewDatas['class_path']}.label.{$field}") . " 선택"];
|
$options = ["" => lang("{$viewDatas['class_path']}.label.{$field}") . " 선택"];
|
||||||
foreach ($viewDatas['control']['filter_optons'][$field] as $key => $entity) {
|
foreach ($viewDatas['control']['field_optons'][$field] as $key => $entity) {
|
||||||
$options[$key] = $entity->getTitle();
|
$options[$key] = $entity->getTitle();
|
||||||
}
|
}
|
||||||
return form_dropdown($field, $options, $value, $extras);;
|
return form_dropdown($field, $options, $value, $extras);;
|
||||||
|
|||||||
@ -16,7 +16,7 @@ class AccountHelper extends CustomerHelper
|
|||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
||||||
$value = array_key_exists($value, $viewDatas['control']['filter_optons'][$field]) ? $viewDatas['control']['filter_optons'][$field][$value]->getTitle() : "";
|
$value = array_key_exists($value, $viewDatas['control']['field_optons'][$field]) ? $viewDatas['control']['field_optons'][$field][$value]->getTitle() : "";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ class CouponHelper extends CustomerHelper
|
|||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
||||||
$value = array_key_exists($value, $viewDatas['control']['filter_optons'][$field]) ? $viewDatas['control']['filter_optons'][$field][$value]->getTitle() : "";
|
$value = array_key_exists($value, $viewDatas['control']['field_optons'][$field]) ? $viewDatas['control']['field_optons'][$field][$value]->getTitle() : "";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,12 +20,12 @@ class PaymentHelper extends CustomerHelper
|
|||||||
break;
|
break;
|
||||||
case 'item_uid':
|
case 'item_uid':
|
||||||
//ItemType에 따라 필터옵션에서 Title을 가져옴
|
//ItemType에 따라 필터옵션에서 Title을 가져옴
|
||||||
$value = $viewDatas['control']['filter_optons'][$viewDatas['entity']->getItemType()][$value]->getTitle();
|
$value = $viewDatas['control']['field_optons'][$viewDatas['entity']->getItemType()][$value]->getTitle();
|
||||||
break;
|
break;
|
||||||
case 'serviceinfo_uid':
|
case 'serviceinfo_uid':
|
||||||
case 'clientinfo_uid':
|
case 'clientinfo_uid':
|
||||||
case 'billing_method':
|
case 'billing_method':
|
||||||
$value = array_key_exists($value, $viewDatas['control']['filter_optons'][$field]) && $viewDatas['control']['filter_optons'][$field][$value] ? $viewDatas['control']['filter_optons'][$field][$value]->getTitle() : "";
|
$value = array_key_exists($value, $viewDatas['control']['field_optons'][$field]) && $viewDatas['control']['field_optons'][$field][$value] ? $viewDatas['control']['field_optons'][$field][$value]->getTitle() : "";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class PointHelper extends CustomerHelper
|
|||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
||||||
$value = array_key_exists($value, $viewDatas['control']['filter_optons'][$field]) ? $viewDatas['control']['filter_optons'][$field][$value]->getTitle() : "";
|
$value = array_key_exists($value, $viewDatas['control']['field_optons'][$field]) ? $viewDatas['control']['field_optons'][$field][$value]->getTitle() : "";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,11 +85,11 @@ class ServiceHelper extends CustomerHelper
|
|||||||
case "DOMAIN":
|
case "DOMAIN":
|
||||||
$temps = ["<ul>"];
|
$temps = ["<ul>"];
|
||||||
foreach ($viewDatas['entity']->getItemEntities($field) as $itemEntity) {
|
foreach ($viewDatas['entity']->getItemEntities($field) as $itemEntity) {
|
||||||
// dd($viewDatas['control']['filter_optons'][$field]);
|
// dd($viewDatas['control']['field_optons'][$field]);
|
||||||
$temps[] = sprintf(
|
$temps[] = sprintf(
|
||||||
"<li title=\"%s\">%s %s %s</li>",
|
"<li title=\"%s\">%s %s %s</li>",
|
||||||
$itemEntity->getView_Price(),
|
$itemEntity->getView_Price(),
|
||||||
$viewDatas['control']['filter_optons'][$field][$itemEntity->getItemUid()]->getTitle(),
|
$viewDatas['control']['field_optons'][$field][$itemEntity->getItemUid()]->getTitle(),
|
||||||
$itemEntity->getView_BillingCycle(),
|
$itemEntity->getView_BillingCycle(),
|
||||||
$itemEntity->getView_Sale()
|
$itemEntity->getView_Sale()
|
||||||
);
|
);
|
||||||
|
|||||||
@ -16,12 +16,12 @@ class HomeHelper extends CommonHelper
|
|||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'item_uid':
|
case 'item_uid':
|
||||||
$value = $viewDatas['control']['filter_optons'][$viewDatas['entity']->getItemType()][$value]->getTitle();
|
$value = $viewDatas['control']['field_optons'][$viewDatas['entity']->getItemType()][$value]->getTitle();
|
||||||
break;
|
break;
|
||||||
case 'type':
|
case 'type':
|
||||||
// echo $value;
|
// echo $value;
|
||||||
// dd($viewDatas['control']['filter_optons'][$field]);
|
// dd($viewDatas['control']['field_optons'][$field]);
|
||||||
$value = $viewDatas['control']['filter_optons'][$field][$value]->getTitle();
|
$value = $viewDatas['control']['field_optons'][$field][$value]->getTitle();
|
||||||
break;
|
break;
|
||||||
case 'amount':
|
case 'amount':
|
||||||
$value = number_format($value) . "원";
|
$value = number_format($value) . "원";
|
||||||
@ -43,14 +43,14 @@ class HomeHelper extends CommonHelper
|
|||||||
// }
|
// }
|
||||||
$temps = [];
|
$temps = [];
|
||||||
foreach ($viewDatas['entity']->getItemEntities($field) as $itemEntity) {
|
foreach ($viewDatas['entity']->getItemEntities($field) as $itemEntity) {
|
||||||
$temps[] = $viewDatas['control']['filter_optons'][$field][$itemEntity->getItemUid()]->getTitle();
|
$temps[] = $viewDatas['control']['field_optons'][$field][$itemEntity->getItemUid()]->getTitle();
|
||||||
}
|
}
|
||||||
$value = implode("<BR>", $temps);
|
$value = implode("<BR>", $temps);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
||||||
if (array_key_exists($value, $viewDatas['control']['filter_optons'][$field])) {
|
if (array_key_exists($value, $viewDatas['control']['field_optons'][$field])) {
|
||||||
$value = $viewDatas['control']['filter_optons'][$field][$value]->getTitle();
|
$value = $viewDatas['control']['field_optons'][$field][$value]->getTitle();
|
||||||
} else {
|
} else {
|
||||||
$value = "";
|
$value = "";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,8 +19,8 @@ class MyLogHelper extends CommonHelper
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
||||||
if (array_key_exists($value, $viewDatas['control']['filter_optons'][$field])) {
|
if (array_key_exists($value, $viewDatas['control']['field_optons'][$field])) {
|
||||||
$value = $viewDatas['control']['filter_optons'][$field][$value]->getTitle();
|
$value = $viewDatas['control']['field_optons'][$field][$value]->getTitle();
|
||||||
} else {
|
} else {
|
||||||
$value = "";
|
$value = "";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,7 +74,7 @@ abstract class CommonModel extends Model
|
|||||||
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
|
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
|
||||||
}
|
}
|
||||||
//기본 기능
|
//기본 기능
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class AccountModel extends CustomerModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -48,7 +48,7 @@ class AccountModel extends CustomerModel
|
|||||||
$rule = "required|valid_date";
|
$rule = "required|valid_date";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class ClientModel extends CustomerModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -62,7 +62,7 @@ class ClientModel extends CustomerModel
|
|||||||
$rule = "permit_empty|numeric";
|
$rule = "permit_empty|numeric";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class CouponModel extends CustomerModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -40,7 +40,7 @@ class CouponModel extends CustomerModel
|
|||||||
$rule = "required|trim|string";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -13,7 +13,7 @@ abstract class CustomerModel extends CommonModel
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -35,7 +35,7 @@ abstract class CustomerModel extends CommonModel
|
|||||||
$rule = "permit_empty|trim|string";
|
$rule = "permit_empty|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class PaymentModel extends CustomerModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -53,7 +53,7 @@ class PaymentModel extends CustomerModel
|
|||||||
$rule = "permit_empty|trim|string";
|
$rule = "permit_empty|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class PointModel extends CustomerModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -40,7 +40,7 @@ class PointModel extends CustomerModel
|
|||||||
$rule = "required|trim|string";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class ServiceModel extends CustomerModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -61,7 +61,7 @@ class ServiceModel extends CustomerModel
|
|||||||
$rule = "permit_empty|trim|string";
|
$rule = "permit_empty|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class CSModel extends EquipmentModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -50,7 +50,7 @@ class CSModel extends EquipmentModel
|
|||||||
$rule = "permit_empty|trim|string";
|
$rule = "permit_empty|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ abstract class EquipmentModel extends CommonModel
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -33,7 +33,7 @@ abstract class EquipmentModel extends CommonModel
|
|||||||
$rule = "permit_empty|trim|string";
|
$rule = "permit_empty|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class IPModel extends EquipmentModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -50,7 +50,7 @@ class IPModel extends EquipmentModel
|
|||||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class LineModel extends EquipmentModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -40,7 +40,7 @@ class LineModel extends EquipmentModel
|
|||||||
$rule = "permit_empty|valid_date";
|
$rule = "permit_empty|valid_date";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class PartModel extends EquipmentModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
final public function getFormFieldRule(string $action, string $field): string
|
final public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -37,7 +37,7 @@ class PartModel extends EquipmentModel
|
|||||||
$rule = "required|numeric";
|
$rule = "required|numeric";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class ServerModel extends EquipmentModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -58,7 +58,7 @@ class ServerModel extends EquipmentModel
|
|||||||
$rule = "permit_empty|valid_date";
|
$rule = "permit_empty|valid_date";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class ServerPartModel extends EquipmentModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
final public function getFormFieldRule(string $action, string $field): string
|
final public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -47,7 +47,7 @@ class ServerPartModel extends EquipmentModel
|
|||||||
$rule = "required|trim|string";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class SwitchModel extends EquipmentModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -35,7 +35,7 @@ class SwitchModel extends EquipmentModel
|
|||||||
$rule = "required|trim|string";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class MyLogModel extends CommonModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -42,7 +42,7 @@ class MyLogModel extends CommonModel
|
|||||||
$rule = "permit_empty|trim|string";
|
$rule = "permit_empty|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class UserModel extends CommonModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
@ -50,7 +50,7 @@ class UserModel extends CommonModel
|
|||||||
$rule = "required|trim|string";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class UserSNSModel extends CommonModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case "id":
|
case "id":
|
||||||
@ -47,7 +47,7 @@ class UserSNSModel extends CommonModel
|
|||||||
$rule = "required|trim|string";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFormFieldRule($action, $field);
|
$rule = parent::getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -25,17 +25,11 @@ class GoogleService extends AuthService
|
|||||||
}
|
}
|
||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return ["access_code"];
|
||||||
'fields' => ["access_code"],
|
|
||||||
'filters' => [],
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return ["access_code"];
|
||||||
'fields' => ["access_code"],
|
|
||||||
'filters' => [],
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
public function getBatchjobButtons(): array
|
public function getBatchjobButtons(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -14,28 +14,11 @@ class LocalService extends AuthService
|
|||||||
}
|
}
|
||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return ["id", "passwd",];
|
||||||
'fields' => [
|
|
||||||
"id",
|
|
||||||
"passwd",
|
|
||||||
],
|
|
||||||
'filters' => [],
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [];
|
||||||
'fields' => [
|
|
||||||
"id",
|
|
||||||
"passwd",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
public function getBatchjobFields(): array
|
|
||||||
{
|
|
||||||
return ['status'];
|
|
||||||
}
|
}
|
||||||
public function getBatchjobButtons(): array
|
public function getBatchjobButtons(): array
|
||||||
{
|
{
|
||||||
@ -44,7 +27,10 @@ class LocalService extends AuthService
|
|||||||
//기본기능
|
//기본기능
|
||||||
public function login(array $formDatas): UserEntity
|
public function login(array $formDatas): UserEntity
|
||||||
{
|
{
|
||||||
$entity = $this->getEntity(['id' => $formDatas['id'], 'status' => UserEntity::DEFAULT_STATUS], false);
|
$entity = $this->getEntity([
|
||||||
|
'id' => $formDatas['id'],
|
||||||
|
'status' => UserEntity::DEFAULT_STATUS
|
||||||
|
], false);
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw new \Exception("{$formDatas['id']}에 대한 로그인 정보를 찾을수 없습니다.");
|
throw new \Exception("{$formDatas['id']}에 대한 로그인 정보를 찾을수 없습니다.");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ abstract class CommonService
|
|||||||
$this->_model = $model;
|
$this->_model = $model;
|
||||||
}
|
}
|
||||||
abstract public function getFormFields(): array;
|
abstract public function getFormFields(): array;
|
||||||
abstract public function getIndexFields(): array;
|
abstract public function getFormFilters(): array;
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
final public function __get($name)
|
final public function __get($name)
|
||||||
{
|
{
|
||||||
@ -160,9 +160,21 @@ abstract class CommonService
|
|||||||
{
|
{
|
||||||
return $this->getFormFields();
|
return $this->getFormFields();
|
||||||
}
|
}
|
||||||
|
public function getViewFilters(): array
|
||||||
|
{
|
||||||
|
return $this->getFormFilters();
|
||||||
|
}
|
||||||
|
public function getIndexFields(): array
|
||||||
|
{
|
||||||
|
return $this->getFormFields();
|
||||||
|
}
|
||||||
|
public function getIndexFilters(): array
|
||||||
|
{
|
||||||
|
return $this->getFormFilters();
|
||||||
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
{
|
{
|
||||||
return [];
|
return $this->getIndexFilters();
|
||||||
}
|
}
|
||||||
public function getBatchjobButtons(): array
|
public function getBatchjobButtons(): array
|
||||||
{
|
{
|
||||||
@ -171,7 +183,7 @@ abstract class CommonService
|
|||||||
'batchjob_delete' => '일괄 삭제',
|
'batchjob_delete' => '일괄 삭제',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getFormFieldOption(string $field, array $options = []): array
|
public function getFormOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
@ -185,16 +197,19 @@ abstract class CommonService
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!is_array($options)) {
|
||||||
|
throw new \Exception(__FUNCTION__ . "에서 {$field}의 options 값이 array가 아닙니다.\n" . var_export($options, true));
|
||||||
|
}
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
public function getFormFieldRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
}
|
}
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
$rule = $this->getModel()->getFormFieldRule($action, $field);
|
$rule = $this->getModel()->getFormRule($action, $field);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -16,39 +16,21 @@ class AccountService extends CustomerService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"clientinfo_uid",
|
||||||
"clientinfo_uid",
|
"bank",
|
||||||
"bank",
|
"title",
|
||||||
"title",
|
"alias",
|
||||||
"alias",
|
"issue_at",
|
||||||
"issue_at",
|
"amount",
|
||||||
"amount",
|
"status",
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"bank",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"clientinfo_uid",
|
||||||
"clientinfo_uid",
|
"bank",
|
||||||
"bank",
|
"status",
|
||||||
"title",
|
|
||||||
"alias",
|
|
||||||
"issue_at",
|
|
||||||
"amount",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"bank",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
|
|||||||
@ -15,41 +15,35 @@ class ClientService extends CustomerService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
'site',
|
||||||
'site',
|
'name',
|
||||||
'name',
|
'email',
|
||||||
'email',
|
'phone',
|
||||||
'phone',
|
'role',
|
||||||
'role',
|
];
|
||||||
],
|
}
|
||||||
'filters' => [
|
public function getFormFilters(): array
|
||||||
'site',
|
{
|
||||||
'role',
|
return [
|
||||||
'status',
|
'site',
|
||||||
],
|
'role',
|
||||||
|
'status',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getIndexFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
'site',
|
||||||
'site',
|
'name',
|
||||||
'name',
|
'email',
|
||||||
'email',
|
'phone',
|
||||||
'phone',
|
'role',
|
||||||
'role',
|
'account_balance',
|
||||||
'account_balance',
|
'coupon_balance',
|
||||||
'coupon_balance',
|
'point_balance',
|
||||||
'point_balance',
|
'status',
|
||||||
'status',
|
'created_at',
|
||||||
'created_at',
|
'updated_at',
|
||||||
'updated_at',
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
'site',
|
|
||||||
'role',
|
|
||||||
'status',
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
|
|||||||
@ -16,31 +16,17 @@ class CouponService extends CustomerService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"clientinfo_uid",
|
||||||
"clientinfo_uid",
|
"title",
|
||||||
"title",
|
"cnt",
|
||||||
"cnt",
|
"status",
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"clientinfo_uid",
|
||||||
"clientinfo_uid",
|
"status",
|
||||||
"title",
|
|
||||||
"cnt",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
|
|||||||
@ -52,7 +52,7 @@ abstract class CustomerService extends CommonService
|
|||||||
//ServiceItemController,ServiceController에서 사용
|
//ServiceItemController,ServiceController에서 사용
|
||||||
//기본기능
|
//기본기능
|
||||||
//FieldForm관련용
|
//FieldForm관련용
|
||||||
public function getFormFieldOption(string $field, array $options = []): array
|
public function getFormOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'user_uid':
|
case 'user_uid':
|
||||||
@ -68,7 +68,7 @@ abstract class CustomerService extends CommonService
|
|||||||
$options = $this->getServerService()->getEntities();
|
$options = $this->getServerService()->getEntities();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormFieldOption($field, $options);
|
$options = parent::getFormOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -25,47 +25,39 @@ class PaymentService extends CustomerService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"clientinfo_uid",
|
||||||
"clientinfo_uid",
|
"serviceinfo_uid",
|
||||||
"serviceinfo_uid",
|
"title",
|
||||||
"title",
|
"amount",
|
||||||
"amount",
|
"billing",
|
||||||
"billing",
|
"billing_at",
|
||||||
"billing_at",
|
"pay",
|
||||||
"pay",
|
"status",
|
||||||
"status"
|
];
|
||||||
],
|
}
|
||||||
'filters' => [
|
public function getFormFilters(): array
|
||||||
'clientinfo_uid',
|
{
|
||||||
'billing',
|
return [
|
||||||
'pay',
|
'clientinfo_uid',
|
||||||
'status',
|
'billing',
|
||||||
'user_uid'
|
'pay',
|
||||||
],
|
'status',
|
||||||
|
'user_uid',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getIndexFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
'clientinfo_uid',
|
||||||
'clientinfo_uid',
|
'billing',
|
||||||
'billing',
|
'title',
|
||||||
'title',
|
'amount',
|
||||||
'amount',
|
'billing_at',
|
||||||
'billing_at',
|
'pay',
|
||||||
'pay',
|
'status',
|
||||||
'status',
|
'updated_at',
|
||||||
'updated_at',
|
'countdown',
|
||||||
'countdown',
|
'user_uid',
|
||||||
'user_uid'
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
'clientinfo_uid',
|
|
||||||
'billing',
|
|
||||||
'pay',
|
|
||||||
'status',
|
|
||||||
'user_uid'
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
@ -80,7 +72,7 @@ class PaymentService extends CustomerService
|
|||||||
}
|
}
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
//FieldForm관련용
|
//FieldForm관련용
|
||||||
public function getFormFieldOption(string $field, array $options = []): array
|
public function getFormOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'user_uid':
|
case 'user_uid':
|
||||||
@ -93,7 +85,7 @@ class PaymentService extends CustomerService
|
|||||||
$options = $this->getServiceService()->getEntities();
|
$options = $this->getServiceService()->getEntities();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormFieldOption($field, $options);
|
$options = parent::getFormOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -16,31 +16,17 @@ class PointService extends CustomerService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"clientinfo_uid",
|
||||||
"clientinfo_uid",
|
"title",
|
||||||
"title",
|
"amount",
|
||||||
"amount",
|
"status",
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"clientinfo_uid",
|
||||||
"clientinfo_uid",
|
"status",
|
||||||
"title",
|
|
||||||
"amount",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"clientinfo_uid",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
|
|||||||
@ -17,53 +17,44 @@ class ServiceService extends CustomerService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"clientinfo_uid",
|
||||||
"clientinfo_uid",
|
"type",
|
||||||
"type",
|
"location",
|
||||||
"location",
|
"serverinfo_uid",
|
||||||
"serverinfo_uid",
|
"billing_at",
|
||||||
"billing_at",
|
"amount",
|
||||||
"amount",
|
"start_at",
|
||||||
"start_at",
|
"end_at",
|
||||||
"end_at",
|
"history",
|
||||||
"history",
|
"status",
|
||||||
"status",
|
];
|
||||||
],
|
}
|
||||||
'filters' => [
|
public function getFormFilters(): array
|
||||||
'site',
|
{
|
||||||
'clientinfo_uid',
|
return [
|
||||||
'serverinfo_uid',
|
'site',
|
||||||
'type',
|
'clientinfo_uid',
|
||||||
'location',
|
'serverinfo_uid',
|
||||||
'status'
|
'type',
|
||||||
],
|
'location',
|
||||||
|
'status',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getIndexFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
'site',
|
||||||
'site',
|
'clientinfo_uid',
|
||||||
'clientinfo_uid',
|
'type',
|
||||||
'type',
|
'location',
|
||||||
'location',
|
'serverinfo_uid',
|
||||||
'serverinfo_uid',
|
'billing_at',
|
||||||
'billing_at',
|
'amount',
|
||||||
'amount',
|
'start_at',
|
||||||
'start_at',
|
'end_at',
|
||||||
'end_at',
|
'updated_at',
|
||||||
'updated_at',
|
'status',
|
||||||
'status',
|
'user_uid'
|
||||||
'user_uid'
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
'site',
|
|
||||||
'clientinfo_uid',
|
|
||||||
'serverinfo_uid',
|
|
||||||
'type',
|
|
||||||
'location',
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
|
|||||||
@ -13,46 +13,39 @@ class CSService extends EquipmentService
|
|||||||
$this->addClassName('CS');
|
$this->addClassName('CS');
|
||||||
}
|
}
|
||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
"serverinfo_uid",
|
||||||
|
"type",
|
||||||
|
"ip",
|
||||||
|
"accountid",
|
||||||
|
"domain",
|
||||||
|
"price",
|
||||||
|
"amount",
|
||||||
|
"status",
|
||||||
|
];
|
||||||
|
}
|
||||||
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"clientinfo_uid",
|
||||||
"serverinfo_uid",
|
'serverinfo_uid',
|
||||||
"type",
|
'type',
|
||||||
"ip",
|
'status'
|
||||||
"accountid",
|
|
||||||
"domain",
|
|
||||||
"price",
|
|
||||||
"amount",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"clientinfo_uid",
|
|
||||||
'serverinfo_uid',
|
|
||||||
'type',
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getIndexFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"clientinfo_uid",
|
||||||
"clientinfo_uid",
|
'serverinfo_uid',
|
||||||
'serverinfo_uid',
|
'type',
|
||||||
'type',
|
'ip',
|
||||||
'ip',
|
'accountid',
|
||||||
'accountid',
|
'domain',
|
||||||
'domain',
|
'price',
|
||||||
'price',
|
"amount",
|
||||||
"amount",
|
'status',
|
||||||
'status'
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"clientinfo_uid",
|
|
||||||
'serverinfo_uid',
|
|
||||||
'type',
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
|
|||||||
@ -52,7 +52,7 @@ abstract class EquipmentService extends CommonService
|
|||||||
}
|
}
|
||||||
//기본기능
|
//기본기능
|
||||||
//FieldForm관련용
|
//FieldForm관련용
|
||||||
public function getFormFieldOption(string $field, array $options = []): array
|
public function getFormOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'user_uid':
|
case 'user_uid':
|
||||||
@ -68,7 +68,7 @@ abstract class EquipmentService extends CommonService
|
|||||||
$options = $this->getServerService()->getEntities();
|
$options = $this->getServerService()->getEntities();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormFieldOption($field, $options);
|
$options = parent::getFormOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -20,44 +20,35 @@ class IPService extends EquipmentService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"lineinfo_uid",
|
||||||
"lineinfo_uid",
|
"serverinfo_uid",
|
||||||
"serverinfo_uid",
|
"ip",
|
||||||
"ip",
|
"price",
|
||||||
"price",
|
"amount",
|
||||||
"amount",
|
"status",
|
||||||
"status",
|
];
|
||||||
],
|
}
|
||||||
'filters' => [
|
public function getFormFilters(): array
|
||||||
'old_clientinfo_uid',
|
{
|
||||||
'clientinfo_uid',
|
return [
|
||||||
'serverinfo_uid',
|
'old_clientinfo_uid',
|
||||||
"lineinfo_uid",
|
'clientinfo_uid',
|
||||||
'status'
|
'serverinfo_uid',
|
||||||
],
|
"lineinfo_uid",
|
||||||
|
'status'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getIndexFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
'lineinfo_uid',
|
||||||
'lineinfo_uid',
|
'ip',
|
||||||
'ip',
|
'price',
|
||||||
'price',
|
"amount",
|
||||||
"amount",
|
'status',
|
||||||
'status',
|
'clientinfo_uid',
|
||||||
'clientinfo_uid',
|
'serverinfo_uid',
|
||||||
'serverinfo_uid',
|
'old_clientinfo_uid'
|
||||||
'old_clientinfo_uid'
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
'old_clientinfo_uid',
|
|
||||||
'clientinfo_uid',
|
|
||||||
'serverinfo_uid',
|
|
||||||
"lineinfo_uid",
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
'batchjob_fields' => ['status'],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
@ -73,7 +64,7 @@ class IPService extends EquipmentService
|
|||||||
}
|
}
|
||||||
//기본기능
|
//기본기능
|
||||||
//FieldForm관련용
|
//FieldForm관련용
|
||||||
public function getFormFieldOption(string $field, $options = []): array
|
public function getFormOption(string $field, $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'lineinfo_uid':
|
case 'lineinfo_uid':
|
||||||
@ -83,7 +74,7 @@ class IPService extends EquipmentService
|
|||||||
$options = $this->getClientService()->getEntities();
|
$options = $this->getClientService()->getEntities();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormFieldOption($field, $options);
|
$options = parent::getFormOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -14,35 +14,19 @@ class LineService extends EquipmentService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"type",
|
||||||
"type",
|
"title",
|
||||||
"title",
|
"bandwith",
|
||||||
"bandwith",
|
"start_at",
|
||||||
"start_at",
|
"end_at",
|
||||||
"end_at",
|
"status",
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"type",
|
|
||||||
'status',
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"type",
|
||||||
'type',
|
'status',
|
||||||
'title',
|
|
||||||
'bandwith',
|
|
||||||
"start_at",
|
|
||||||
"end_at",
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"type",
|
|
||||||
'status',
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
|
|||||||
@ -14,32 +14,17 @@ class PartService extends EquipmentService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"type",
|
||||||
"type",
|
"title",
|
||||||
"title",
|
"price",
|
||||||
"price",
|
"status",
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"type",
|
|
||||||
'status',
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"type",
|
||||||
'type',
|
'status',
|
||||||
'title',
|
|
||||||
'price',
|
|
||||||
'status',
|
|
||||||
'created_at'
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"type",
|
|
||||||
'status',
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
|
|||||||
@ -18,27 +18,24 @@ class ServerPartService extends EquipmentService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"partinfo_uid",
|
||||||
"partinfo_uid",
|
"serverinfo_uid",
|
||||||
"serverinfo_uid",
|
"serviceinfo_uid",
|
||||||
"serviceinfo_uid",
|
"type",
|
||||||
"type",
|
"billing",
|
||||||
"billing",
|
"amount",
|
||||||
"amount",
|
"cnt",
|
||||||
"cnt",
|
"extra",
|
||||||
"extra",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"partinfo_uid",
|
|
||||||
"serverinfo_uid",
|
|
||||||
"serviceinfo_uid",
|
|
||||||
"type"
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return $this->getFormFields();
|
return [
|
||||||
|
"partinfo_uid",
|
||||||
|
"serverinfo_uid",
|
||||||
|
"serviceinfo_uid",
|
||||||
|
"type"
|
||||||
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
{
|
{
|
||||||
@ -63,7 +60,7 @@ class ServerPartService extends EquipmentService
|
|||||||
}
|
}
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
// FieldForm관련용
|
// FieldForm관련용
|
||||||
public function getFormFieldOption(string $field, array $options = []): array
|
public function getFormOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'partinfo_uid_CPU':
|
case 'partinfo_uid_CPU':
|
||||||
@ -88,7 +85,7 @@ class ServerPartService extends EquipmentService
|
|||||||
$options = $this->getPartService()->getEntities();
|
$options = $this->getPartService()->getEntities();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormFieldOption($field, $options);
|
$options = parent::getFormOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -18,69 +18,71 @@ class ServerService extends EquipmentService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"code",
|
||||||
"code",
|
"type",
|
||||||
"type",
|
"title",
|
||||||
"title",
|
"price",
|
||||||
"price",
|
"amount",
|
||||||
"amount",
|
"manufactur_at",
|
||||||
"manufactur_at",
|
"format_at",
|
||||||
"format_at",
|
"status",
|
||||||
"status",
|
"partinfo_uid_CPU",
|
||||||
"partinfo_uid_CPU",
|
"serverinfopartinfo_uid_CPU_cnt",
|
||||||
"serverinfopartinfo_uid_CPU_cnt",
|
"partinfo_uid_RAM",
|
||||||
"partinfo_uid_RAM",
|
"serverinfopartinfo_uid_RAM_cnt",
|
||||||
"serverinfopartinfo_uid_RAM_cnt",
|
"partinfo_uid_DISK",
|
||||||
"partinfo_uid_DISK",
|
"serverinfopartinfo_uid_DISK_cnt",
|
||||||
"serverinfopartinfo_uid_DISK_cnt",
|
"serverinfopartinfo_uid_DISK_extra",
|
||||||
"serverinfopartinfo_uid_DISK_extra",
|
"partinfo_uid_OS",
|
||||||
"partinfo_uid_OS",
|
"serverinfopartinfo_uid_OS_cnt",
|
||||||
"serverinfopartinfo_uid_OS_cnt",
|
"partinfo_uid_SOFTWARE",
|
||||||
"partinfo_uid_SOFTWARE",
|
"serverinfopartinfo_uid_SOFTWARE_cnt",
|
||||||
"serverinfopartinfo_uid_SOFTWARE_cnt",
|
"ipinfo_uid",
|
||||||
"ipinfo_uid",
|
"csinfo_uid",
|
||||||
"csinfo_uid",
|
];
|
||||||
],
|
}
|
||||||
'filters' => [
|
public function getFormFilters(): array
|
||||||
"clientinfo_uid",
|
{
|
||||||
"serviceinfo_uid",
|
return [
|
||||||
"type",
|
"clientinfo_uid",
|
||||||
"title",
|
"serviceinfo_uid",
|
||||||
"partinfo_uid_CPU",
|
"type",
|
||||||
"partinfo_uid_RAM",
|
"title",
|
||||||
"partinfo_uid_DISK",
|
"partinfo_uid_CPU",
|
||||||
"serverinfopartinfo_uid_DISK_extra",
|
"partinfo_uid_RAM",
|
||||||
"partinfo_uid_OS",
|
"partinfo_uid_DISK",
|
||||||
"partinfo_uid_SOFTWARE",
|
"serverinfopartinfo_uid_DISK_extra",
|
||||||
"ipinfo_uid",
|
"partinfo_uid_OS",
|
||||||
"csinfo_uid",
|
"partinfo_uid_SOFTWARE",
|
||||||
"status"
|
"ipinfo_uid",
|
||||||
],
|
"csinfo_uid",
|
||||||
|
"status"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getIndexFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
'clientinfo_uid',
|
||||||
'clientinfo_uid',
|
'serviceinfo_uid',
|
||||||
'serviceinfo_uid',
|
"type",
|
||||||
"type",
|
'title',
|
||||||
'title',
|
'price',
|
||||||
'price',
|
'amount',
|
||||||
'amount',
|
'manufactur_at',
|
||||||
'manufactur_at',
|
"format_at",
|
||||||
"format_at",
|
'status'
|
||||||
'status'
|
];
|
||||||
],
|
}
|
||||||
'filters' => [
|
public function getIndexFilters(): array
|
||||||
'clientinfo_uid',
|
{
|
||||||
'serviceinfo_uid',
|
return [
|
||||||
'type',
|
'clientinfo_uid',
|
||||||
"ipinfo_uid",
|
'serviceinfo_uid',
|
||||||
"csinfo_uid",
|
'type',
|
||||||
'partinfo_uid_SOFTWARE',
|
"ipinfo_uid",
|
||||||
'status'
|
"csinfo_uid",
|
||||||
],
|
'partinfo_uid_SOFTWARE',
|
||||||
|
'status'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
@ -129,26 +131,26 @@ class ServerService extends EquipmentService
|
|||||||
return $entity;
|
return $entity;
|
||||||
}
|
}
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
public function getFormFieldOption(string $field, array $options = []): array
|
public function getFormOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'partinfo_uid_CPU':
|
case 'partinfo_uid_CPU':
|
||||||
$options = $this->getServerPartService()->getFormFieldOption('partinfo_uid_CPU');
|
$options = $this->getServerPartService()->getFormOption('partinfo_uid_CPU');
|
||||||
break;
|
break;
|
||||||
case 'partinfo_uid_RAM':
|
case 'partinfo_uid_RAM':
|
||||||
$options = $this->getServerPartService()->getFormFieldOption('partinfo_uid_RAM');
|
$options = $this->getServerPartService()->getFormOption('partinfo_uid_RAM');
|
||||||
break;
|
break;
|
||||||
case 'partinfo_uid_DISK':
|
case 'partinfo_uid_DISK':
|
||||||
$options = $this->getServerPartService()->getFormFieldOption('partinfo_uid_DISK');
|
$options = $this->getServerPartService()->getFormOption('partinfo_uid_DISK');
|
||||||
break;
|
break;
|
||||||
case 'partinfo_uid_OS':
|
case 'partinfo_uid_OS':
|
||||||
$options = $this->getServerPartService()->getFormFieldOption('partinfo_uid_OS');
|
$options = $this->getServerPartService()->getFormOption('partinfo_uid_OS');
|
||||||
break;
|
break;
|
||||||
case 'partinfo_uid_DB':
|
case 'partinfo_uid_DB':
|
||||||
$options = $this->getServerPartService()->getFormFieldOption('partinfo_uid_DB');
|
$options = $this->getServerPartService()->getFormOption('partinfo_uid_DB');
|
||||||
break;
|
break;
|
||||||
case 'partinfo_uid_SOFTWARE':
|
case 'partinfo_uid_SOFTWARE':
|
||||||
$options = $this->getServerPartService()->getFormFieldOption('partinfo_uid_SOFTWARE');
|
$options = $this->getServerPartService()->getFormOption('partinfo_uid_SOFTWARE');
|
||||||
break;
|
break;
|
||||||
case 'ipinfo_uid': //수정때문에 전체가 필요
|
case 'ipinfo_uid': //수정때문에 전체가 필요
|
||||||
$options = $this->getIPService()->getEntities();
|
$options = $this->getIPService()->getEntities();
|
||||||
@ -157,7 +159,7 @@ class ServerService extends EquipmentService
|
|||||||
$options = $this->getCSService()->getEntities();
|
$options = $this->getCSService()->getEntities();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormFieldOption($field, $options);
|
$options = parent::getFormOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -16,35 +16,37 @@ class SwitchService extends EquipmentService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"serverinfo_uid",
|
||||||
"serverinfo_uid",
|
"code",
|
||||||
"code",
|
"status",
|
||||||
"status",
|
];
|
||||||
],
|
}
|
||||||
'filters' => [
|
public function getFormFilters(): array
|
||||||
'clientinfo_uid',
|
{
|
||||||
'serviceinfo_uid',
|
return [
|
||||||
'serverinfo_uid',
|
'clientinfo_uid',
|
||||||
'status'
|
'serviceinfo_uid',
|
||||||
],
|
'serverinfo_uid',
|
||||||
|
'status'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getIndexFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
'code',
|
||||||
'code',
|
'status',
|
||||||
'status',
|
'clientinfo_uid',
|
||||||
'clientinfo_uid',
|
'serviceinfo_uid',
|
||||||
'serviceinfo_uid',
|
'serverinfo_uid'
|
||||||
'serverinfo_uid'
|
];
|
||||||
],
|
}
|
||||||
'filters' => [
|
public function getIndexFilters(): array
|
||||||
'clientinfo_uid',
|
{
|
||||||
'serviceinfo_uid',
|
return [
|
||||||
'serverinfo_uid',
|
'clientinfo_uid',
|
||||||
'status'
|
'serviceinfo_uid',
|
||||||
],
|
'serverinfo_uid',
|
||||||
|
'status'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
|
|||||||
@ -18,31 +18,17 @@ class MyLogService extends CommonService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"user_uid",
|
||||||
"user_uid",
|
"title",
|
||||||
"title",
|
"content",
|
||||||
"content",
|
"status",
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
'user_uid',
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
'user_uid',
|
||||||
'user_uid',
|
'status'
|
||||||
'title',
|
|
||||||
'status',
|
|
||||||
'created_at'
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
'user_uid',
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
@ -58,14 +44,14 @@ class MyLogService extends CommonService
|
|||||||
}
|
}
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
//FieldForm관련용
|
//FieldForm관련용
|
||||||
public function getFormFieldOption(string $field, array $options = []): array
|
public function getFormOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'user_uid':
|
case 'user_uid':
|
||||||
$options = $this->getUserService()->getEntities();
|
$options = $this->getUserService()->getEntities();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormFieldOption($field, $options);
|
$options = parent::getFormOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -16,39 +16,21 @@ class UserSNSService extends CommonService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"site",
|
||||||
"site",
|
"user_uid",
|
||||||
"user_uid",
|
"id",
|
||||||
"id",
|
"name",
|
||||||
"name",
|
"email",
|
||||||
"email",
|
"detail",
|
||||||
"detail",
|
"status",
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"site",
|
|
||||||
"user_uid",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
"site",
|
||||||
"site",
|
"user_uid",
|
||||||
"user_uid",
|
"status",
|
||||||
"id",
|
|
||||||
"name",
|
|
||||||
"email",
|
|
||||||
"detail",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
"site",
|
|
||||||
"user_uid",
|
|
||||||
"status",
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
|
|||||||
@ -15,53 +15,30 @@ class UserService extends CommonService
|
|||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
'id',
|
||||||
'id',
|
'passwd',
|
||||||
'passwd',
|
'confirmpassword',
|
||||||
'confirmpassword',
|
'name',
|
||||||
'name',
|
'email',
|
||||||
'email',
|
'mobile',
|
||||||
'mobile',
|
'role'
|
||||||
'role'
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
'role',
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getViewFields(): array
|
public function getFormFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
'role',
|
||||||
'id',
|
'status'
|
||||||
'name',
|
|
||||||
'email',
|
|
||||||
'mobile',
|
|
||||||
'role',
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
'role',
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getIndexFields(): array
|
public function getIndexFields(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'fields' => [
|
'id',
|
||||||
'id',
|
'name',
|
||||||
'name',
|
'email',
|
||||||
'email',
|
'mobile',
|
||||||
'mobile',
|
'role'
|
||||||
'role',
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
'filters' => [
|
|
||||||
'role',
|
|
||||||
'status'
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getBatchjobFields(): array
|
public function getBatchjobFields(): array
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
|
||||||
<td nowrap class="text-start">
|
<td nowrap class="text-start">
|
||||||
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['control']['field_default_values'][$field] ?? null), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['control']['form_datas'][$field] ?? null), $viewDatas) ?>
|
||||||
<span><?= validation_show_error($field); ?></span>
|
<span><?= validation_show_error($field); ?></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
|
||||||
<td nowrap class="text-start">
|
<td nowrap class="text-start">
|
||||||
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['control']['field_default_values'][$field] ?? null), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['control']['form_datas'][$field] ?? null), $viewDatas) ?>
|
||||||
<span><?= validation_show_error($field); ?></span>
|
<span><?= validation_show_error($field); ?></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
<?php foreach (["code", "type", "title", "price", "amount", "manufactur_at", "format_at", "status",] as $field): ?>
|
<?php foreach (["code", "type", "title", "price", "amount", "manufactur_at", "format_at", "status",] as $field): ?>
|
||||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
|
||||||
<td nowrap class="text-start">
|
<td nowrap class="text-start">
|
||||||
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['control']['field_default_values'][$field] ?? null), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['control']['form_datas'][$field] ?? null), $viewDatas) ?>
|
||||||
<span><?= validation_show_error($field); ?></span>
|
<span><?= validation_show_error($field); ?></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -30,12 +30,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("partinfo_uid_{$partType}", lang("{$viewDatas['class_path']}.label.partinfo_uid_{$partType}"), $viewDatas) ?></th>
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("partinfo_uid_{$partType}", lang("{$viewDatas['class_path']}.label.partinfo_uid_{$partType}"), $viewDatas) ?></th>
|
||||||
<td nowrap class="text-start">
|
<td nowrap class="text-start">
|
||||||
<?= $viewDatas['helper']->getFieldForm("partinfo_uid_{$partType}", old("partinfo_uid_{$partType}") ?? ($viewDatas['control']['field_default_values']["partinfo_uid_{$partType}"] ?? null), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm("partinfo_uid_{$partType}", old("partinfo_uid_{$partType}") ?? ($viewDatas['control']['form_datas']["partinfo_uid_{$partType}"] ?? null), $viewDatas) ?>
|
||||||
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_cnt", old("serverinfopartinfo_uid_{$partType}_cnt") ?? ($viewDatas['control']['field_default_values']["serverinfopartinfo_uid_{$partType}_cnt"] ?? null), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_cnt", old("serverinfopartinfo_uid_{$partType}_cnt") ?? ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_cnt"] ?? null), $viewDatas) ?>
|
||||||
<?php if ($partType === "DISK"): ?>
|
<?php if ($partType === "DISK"): ?>
|
||||||
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_extra", old("serverinfopartinfo_uid_{$partType}_extra") ?? ($viewDatas['control']['field_default_values']["serverinfopartinfo_uid_{$partType}_extra"] ?? null), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_extra", old("serverinfopartinfo_uid_{$partType}_extra") ?? ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_extra"] ?? null), $viewDatas) ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
,금액 <?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_amount", old("serverinfopartinfo_uid_{$partType}_amount") ?? ($viewDatas['control']['field_default_values']["serverinfopartinfo_uid_{$partType}_amount"] ?? null), $viewDatas) ?>
|
,금액 <?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_amount", old("serverinfopartinfo_uid_{$partType}_amount") ?? ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_amount"] ?? null), $viewDatas) ?>
|
||||||
<span><?= validation_show_error("partinfo_uid_{$partType}"); ?></span>
|
<span><?= validation_show_error("partinfo_uid_{$partType}"); ?></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -43,15 +43,15 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("ipinfo_uid", lang("{$viewDatas['class_path']}.label.ipinfo_uid"), $viewDatas) ?></th>
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("ipinfo_uid", lang("{$viewDatas['class_path']}.label.ipinfo_uid"), $viewDatas) ?></th>
|
||||||
<td nowrap class="text-start">
|
<td nowrap class="text-start">
|
||||||
<?= $viewDatas['helper']->getFieldForm("ipinfo_uid", old("ipinfo_uid") ?? ($viewDatas['control']['field_default_values']["ipinfo_uid"] ?? null), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm("ipinfo_uid", old("ipinfo_uid") ?? ($viewDatas['control']['form_datas']["ipinfo_uid"] ?? null), $viewDatas) ?>
|
||||||
,금액 <?= $viewDatas['helper']->getFieldForm("ipinfo_uid_amount", old("ipinfo_uid_amount") ?? ($viewDatas['control']['field_default_values']["ipinfo_uid_amount"] ?? null), $viewDatas) ?>
|
,금액 <?= $viewDatas['helper']->getFieldForm("ipinfo_uid_amount", old("ipinfo_uid_amount") ?? ($viewDatas['control']['form_datas']["ipinfo_uid_amount"] ?? null), $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("csinfo_uid", lang("{$viewDatas['class_path']}.label.csinfo_uid"), $viewDatas) ?></th>
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("csinfo_uid", lang("{$viewDatas['class_path']}.label.csinfo_uid"), $viewDatas) ?></th>
|
||||||
<td nowrap class="text-start">
|
<td nowrap class="text-start">
|
||||||
<?= $viewDatas['helper']->getFieldForm("csinfo_uid", old("csinfo_uid") ?? ($viewDatas['control']['field_default_values']["csinfo_uid"] ?? null), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm("csinfo_uid", old("csinfo_uid") ?? ($viewDatas['control']['form_datas']["csinfo_uid"] ?? null), $viewDatas) ?>
|
||||||
,금액 <?= $viewDatas['helper']->getFieldForm("csinfo_uid_amount", old("csinfo_uid_amount") ?? ($viewDatas['control']['field_default_values']["csinfo_uid_amount"] ?? null), $viewDatas) ?>
|
,금액 <?= $viewDatas['helper']->getFieldForm("csinfo_uid_amount", old("csinfo_uid_amount") ?? ($viewDatas['control']['form_datas']["csinfo_uid_amount"] ?? null), $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@ -30,12 +30,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("partinfo_uid_{$partType}", lang("{$viewDatas['class_path']}.label.partinfo_uid_{$partType}"), $viewDatas) ?></th>
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("partinfo_uid_{$partType}", lang("{$viewDatas['class_path']}.label.partinfo_uid_{$partType}"), $viewDatas) ?></th>
|
||||||
<td nowrap class="text-start">
|
<td nowrap class="text-start">
|
||||||
<?= $viewDatas['helper']->getFieldForm("partinfo_uid_{$partType}", old("partinfo_uid_{$partType}") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getPartInfoUID() : ($viewDatas['control']['field_default_values']["partinfo_uid_{$partType}"] ?? null)), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm("partinfo_uid_{$partType}", old("partinfo_uid_{$partType}") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getPartInfoUID() : ($viewDatas['control']['form_datas']["partinfo_uid_{$partType}"] ?? null)), $viewDatas) ?>
|
||||||
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_cnt", old("serverinfopartinfo_uid_{$partType}_cnt") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getCnt() : ($viewDatas['control']['field_default_values']["serverinfopartinfo_uid_{$partType}_cnt"] ?? null)), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_cnt", old("serverinfopartinfo_uid_{$partType}_cnt") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getCnt() : ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_cnt"] ?? null)), $viewDatas) ?>
|
||||||
<?php if ($partType === "DISK"): ?>
|
<?php if ($partType === "DISK"): ?>
|
||||||
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_extra", old("serverinfopartinfo_uid_{$partType}_extra") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getExtra() : ($viewDatas['control']['field_default_values']["serverinfopartinfo_uid_{$partType}_extra"] ?? null)), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_extra", old("serverinfopartinfo_uid_{$partType}_extra") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getExtra() : ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_extra"] ?? null)), $viewDatas) ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
,금액 <?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_amount", ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getAmount() : ($viewDatas['control']['field_default_values']["serverinfopartinfo_uid_{$partType}_amount"] ?? null)), $viewDatas) ?>
|
,금액 <?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_amount", ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getAmount() : ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_amount"] ?? null)), $viewDatas) ?>
|
||||||
<span><?= validation_show_error("partinfo_uid_{$partType}"); ?></span>
|
<span><?= validation_show_error("partinfo_uid_{$partType}"); ?></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -44,8 +44,8 @@
|
|||||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("ipinfo_uid", lang("{$viewDatas['class_path']}.label.ipinfo_uid"), $viewDatas) ?></th>
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("ipinfo_uid", lang("{$viewDatas['class_path']}.label.ipinfo_uid"), $viewDatas) ?></th>
|
||||||
<td nowrap class="text-start">
|
<td nowrap class="text-start">
|
||||||
<?php foreach ($viewDatas['entity']->getIPEntities() as $entity): ?>
|
<?php foreach ($viewDatas['entity']->getIPEntities() as $entity): ?>
|
||||||
<?= $viewDatas['helper']->getFieldForm("ipinfo_uid", old("ipinfo_uid") ?? ($viewDatas['control']['field_default_values']["ipinfo_uid"] ?? null), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm("ipinfo_uid", old("ipinfo_uid") ?? ($viewDatas['control']['form_datas']["ipinfo_uid"] ?? null), $viewDatas) ?>
|
||||||
,금액 <?= $viewDatas['helper']->getFieldForm("ipinfo_uid_amount", ($ipEntity ? $ipEntity->getAmount() : ($viewDatas['control']['field_default_values']["ipinfo_amount"] ?? null)), $viewDatas) ?>
|
,금액 <?= $viewDatas['helper']->getFieldForm("ipinfo_uid_amount", ($ipEntity ? $ipEntity->getAmount() : ($viewDatas['control']['form_datas']["ipinfo_amount"] ?? null)), $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -53,8 +53,8 @@
|
|||||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("csinfo_uid", lang("{$viewDatas['class_path']}.label.csinfo_uid"), $viewDatas) ?></th>
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("csinfo_uid", lang("{$viewDatas['class_path']}.label.csinfo_uid"), $viewDatas) ?></th>
|
||||||
<td nowrap class="text-start">
|
<td nowrap class="text-start">
|
||||||
<?php foreach ($viewDatas['entity']->getCSEntities() as $entity): ?>
|
<?php foreach ($viewDatas['entity']->getCSEntities() as $entity): ?>
|
||||||
<?= $viewDatas['helper']->getFieldForm("csinfo_uid", old("csinfo_uid") ?? ($viewDatas['control']['field_default_values']["csinfo_uid"] ?? null), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm("csinfo_uid", old("csinfo_uid") ?? ($viewDatas['control']['form_datas']["csinfo_uid"] ?? null), $viewDatas) ?>
|
||||||
,금액 <?= $viewDatas['helper']->getFieldForm("csinfo_uid_amount", ($entity ? $entity->getAmount() : ($viewDatas['control']['field_default_values']["csinfo_amount"] ?? null)), $viewDatas) ?>
|
,금액 <?= $viewDatas['helper']->getFieldForm("csinfo_uid_amount", ($entity ? $entity->getAmount() : ($viewDatas['control']['form_datas']["csinfo_amount"] ?? null)), $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<nav class="condition nav">
|
<nav class="condition nav">
|
||||||
조건:
|
조건:
|
||||||
<?php foreach ($viewDatas['control']['actionFilters'] as $field): ?>
|
<?php foreach ($viewDatas['control']['actionFilters'] as $field): ?>
|
||||||
<?= $viewDatas['helper']->getListFilter($field, $viewDatas['control']['filter_values'][$field] ?? old($field), $viewDatas, ['id' => $field]) ?>
|
<?= $viewDatas['helper']->getListFilter($field, $viewDatas['control']['form_datas'][$field] ?? old($field), $viewDatas, ['id' => $field]) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</nav>
|
</nav>
|
||||||
<nav class="search nav justify-content-center">
|
<nav class="search nav justify-content-center">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user