dbmsv4 init...2
This commit is contained in:
parent
2cf179f8e6
commit
809dc62cdf
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -21,4 +21,8 @@ class AccountEntity extends CustomerEntity
|
|||||||
{
|
{
|
||||||
return $this->attributes['content'] ?? null;
|
return $this->attributes['content'] ?? null;
|
||||||
}
|
}
|
||||||
|
public function getAmount(): int
|
||||||
|
{
|
||||||
|
return $this->attributes['amount'] ?? 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,4 +21,8 @@ class CouponEntity extends CustomerEntity
|
|||||||
{
|
{
|
||||||
return $this->attributes['content'] ?? null;
|
return $this->attributes['content'] ?? null;
|
||||||
}
|
}
|
||||||
|
public function getCnt(): int
|
||||||
|
{
|
||||||
|
return $this->attributes['cnt'] ?? 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,4 +21,8 @@ class PointEntity extends CustomerEntity
|
|||||||
{
|
{
|
||||||
return $this->attributes['content'] ?? null;
|
return $this->attributes['content'] ?? null;
|
||||||
}
|
}
|
||||||
|
public function getAmount(): int
|
||||||
|
{
|
||||||
|
return $this->attributes['amount'] ?? 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,11 +117,13 @@ class AccountService extends CustomerService
|
|||||||
}
|
}
|
||||||
protected function create_process(array $formDatas): AccountEntity
|
protected function create_process(array $formDatas): AccountEntity
|
||||||
{
|
{
|
||||||
return parent::create_process($formDatas);
|
$entity = parent::create_process($formDatas);
|
||||||
|
service('customer_clientservice')->updateBalance($entity->getClientInfoUID(), 'account_balance', $entity->getAmount());
|
||||||
|
return $entity;
|
||||||
}
|
}
|
||||||
protected function modify_process($entity, array $formDatas): AccountEntity
|
protected function modify_process($entity, array $formDatas): AccountEntity
|
||||||
{
|
{
|
||||||
return parent::modify_process($entity, $formDatas);
|
throw new RuntimeException("예치금정보는 수정이 불가합니다.");
|
||||||
}
|
}
|
||||||
//List 검색용
|
//List 검색용
|
||||||
//FormFilter 조건절 처리
|
//FormFilter 조건절 처리
|
||||||
|
|||||||
@ -110,6 +110,19 @@ class ClientService extends CustomerService
|
|||||||
$this->getFormService()->setIndexFilters($indexFilter);
|
$this->getFormService()->setIndexFilters($indexFilter);
|
||||||
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
$this->getFormService()->setBatchjobFilters($batchjobFilters);
|
||||||
}
|
}
|
||||||
|
final public function updateBalance(int|ClientEntity $uid, string $field, int $value): ClientEntity
|
||||||
|
{
|
||||||
|
$entity = is_int($uid) ? $this->getEntity($uid) : $uid;
|
||||||
|
if (!$entity instanceof ClientEntity) {
|
||||||
|
throw new RuntimeException(__METHOD__ . "에서 오류발생: {$uid}에 해당하는 서비스정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
//총 서비스금액 설정
|
||||||
|
$formDatas = [$field => $value];
|
||||||
|
$fields = array_keys($formDatas);
|
||||||
|
$this->getFormService()->setFormFields($fields);
|
||||||
|
$this->getFormService()->setFormRules('modify', $fields);
|
||||||
|
return parent::modify_process($entity, $formDatas);
|
||||||
|
}
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
protected function getEntity_process(mixed $entity): ClientEntity
|
protected function getEntity_process(mixed $entity): ClientEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -7,7 +7,6 @@ use App\Models\Customer\CouponModel;
|
|||||||
use App\Helpers\Customer\CouponHelper;
|
use App\Helpers\Customer\CouponHelper;
|
||||||
use App\Forms\Customer\CouponForm;
|
use App\Forms\Customer\CouponForm;
|
||||||
use App\Entities\Customer\CouponEntity;
|
use App\Entities\Customer\CouponEntity;
|
||||||
use App\Entities\CommonEntity;
|
|
||||||
use App\DTOs\Customer\CouponDTO;
|
use App\DTOs\Customer\CouponDTO;
|
||||||
|
|
||||||
class CouponService extends CustomerService
|
class CouponService extends CustomerService
|
||||||
@ -108,11 +107,13 @@ class CouponService extends CustomerService
|
|||||||
}
|
}
|
||||||
protected function create_process(array $formDatas): CouponEntity
|
protected function create_process(array $formDatas): CouponEntity
|
||||||
{
|
{
|
||||||
return parent::create_process($formDatas);
|
$entity = parent::create_process($formDatas);
|
||||||
|
service('customer_clientservice')->updateBalance($entity->getClientInfoUID(), 'coupon_balance', $entity->getCnt());
|
||||||
|
return $entity;
|
||||||
}
|
}
|
||||||
protected function modify_process($entity, array $formDatas): CouponEntity
|
protected function modify_process($entity, array $formDatas): CouponEntity
|
||||||
{
|
{
|
||||||
return parent::modify_process($entity, $formDatas);
|
throw new RuntimeException("쿠폰정보는 수정이 불가합니다.");
|
||||||
}
|
}
|
||||||
//List 검색용
|
//List 검색용
|
||||||
//FormFilter 조건절 처리
|
//FormFilter 조건절 처리
|
||||||
|
|||||||
@ -108,11 +108,13 @@ class PointService extends CustomerService
|
|||||||
}
|
}
|
||||||
protected function create_process(array $formDatas): PointEntity
|
protected function create_process(array $formDatas): PointEntity
|
||||||
{
|
{
|
||||||
return parent::create_process($formDatas);
|
$entity = parent::create_process($formDatas);
|
||||||
|
service('customer_clientservice')->updateBalance($entity->getClientInfoUID(), 'point_balance', $entity->getAmount());
|
||||||
|
return $entity;
|
||||||
}
|
}
|
||||||
protected function modify_process($entity, array $formDatas): PointEntity
|
protected function modify_process($entity, array $formDatas): PointEntity
|
||||||
{
|
{
|
||||||
return parent::modify_process($entity, $formDatas);
|
throw new RuntimeException("포인트정보는 수정이 불가합니다.");
|
||||||
}
|
}
|
||||||
//List 검색용
|
//List 검색용
|
||||||
//FormFilter 조건절 처리
|
//FormFilter 조건절 처리
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user