servermgrv2 init...

This commit is contained in:
최준흠 2023-07-25 11:13:21 +09:00
parent 7ee21a2a19
commit 0a2356080e
7 changed files with 15 additions and 11 deletions

View File

@ -233,7 +233,7 @@ abstract class BaseController extends Controller
final public function update_form($uid)
{
try {
$entity = $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
$this->_viewDatas['fields'] = $this->_model->getFields('update');
$this->_viewDatas['fieldRules'] = $this->_model->getFieldRules($this->_viewDatas['fields'], 'update');
$this->_viewDatas['fieldFilters'] = $this->_model->getFieldFilters();
@ -268,7 +268,7 @@ abstract class BaseController extends Controller
{
$message = "";
try {
$entity = $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
$this->_viewDatas['fields'] = $this->_model->getFields('update');
$this->_viewDatas['fieldRules'] = $this->_model->getFieldRules($this->_viewDatas['fields'], 'update');
$this->_viewDatas['fieldFilters'] = $this->_model->getFieldFilters();
@ -300,7 +300,7 @@ abstract class BaseController extends Controller
{
$message = "";
try {
$entity = $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
$this->_viewDatas['fields'] = [$field];
$this->_viewDatas['fieldRules'] = $this->_model->getFieldRules($this->_viewDatas['fields'], 'toggle');
$this->_viewDatas['fieldFilters'] = $this->_model->getFieldFilters();
@ -350,7 +350,7 @@ abstract class BaseController extends Controller
$this->_viewDatas['fieldFilters'] = $this->_model->getFieldFilters();
$entitys = array();
foreach ($uids as $uid) {
$entity = $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
try {
$entity = $this->batchjob_validate($entity);
array_push($entitys, $this->batchjob_process($entity));
@ -384,7 +384,7 @@ abstract class BaseController extends Controller
{
$message = "";
try {
$entity = $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
$this->delete_process($entity);
$message = "{$entity->getTitle()} " . __FUNCTION__ . " 완료하였습니다.";
log_message("info", "{$this->_viewDatas['title']} {$message}");

View File

@ -3,7 +3,6 @@
namespace App\Models;
use CodeIgniter\Model;
use App\Libraries\Log\Log;
use App\Entities\BaseEntity;
abstract class BaseModel extends Model

View File

@ -73,7 +73,7 @@ class BoardConfigModel extends BaseModel
public function getEntity($conditions): BoardConfigEntity
{
$entity = $this->asObject(BoardConfigEntity::class)->where($conditions)->first();
return $entity ?: throw new \Exception("{$conditions}해당 데이터가 없습니다.\n ");
return $entity ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
}
public function getEntitys($conditions): array
{

View File

@ -59,7 +59,7 @@ class BoardModel extends BaseHierarchyModel
public function getEntity($conditions): BoardEntity
{
$entity = $this->asObject(BoardEntity::class)->where($conditions)->first();
return $entity ?: throw new \Exception("{$conditions}해당 데이터가 없습니다.\n ");
return $entity ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
}
public function getEntitys($conditions): array
{

View File

@ -70,7 +70,7 @@ class HPILOModel extends BaseModel
public function getEntity($conditions): HPILOEntity
{
$entity = $this->asObject(HPILOEntity::class)->where($conditions)->first();
return $entity ?: throw new \Exception("{$conditions}해당 정보가 없습니다.\n ");
return $entity ?: throw new \Exception("해당 정보가 없습니다.\n " . var_export($conditions, true));
}
public function getEntitys($conditions): array
{
@ -80,6 +80,11 @@ class HPILOModel extends BaseModel
protected function changeFormData(string $field, array $formDatas, $entity)
{
switch ($field) {
case "passwd": //API에서 사용하므로 암호를 바꾸면 않됨
if (array_key_exists($field, $formDatas) && $formDatas[$field]) {
$entity->$field = $formDatas[$field];
}
break;
default:
return parent::changeFormData($field, $formDatas, $entity);
break;

View File

@ -67,7 +67,7 @@ class UserModel extends BaseModel
public function getEntity($conditions): UserEntity
{
$entity = $this->asObject(UserEntity::class)->where($conditions)->first();
return $entity ?: throw new \Exception("{$conditions}의 해당 사용자가 없습니다.\n ");
return $entity ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
}
public function getEntitys($conditions): array
{

View File

@ -61,7 +61,7 @@ class UserSNSModel extends BaseModel
public function getEntity($conditions): UserSNSEntity
{
$entity = $this->asObject(UserSNSEntity::class)->where($conditions)->first();
return $entity ?: throw new \Exception("{$conditions}해당 데이터가 없습니다.\n ");
return $entity ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
}
public function getEntitys($conditions): array
{