dbmsv2 init...1
This commit is contained in:
parent
f08f5f239f
commit
ab79f8391b
@ -81,8 +81,7 @@ defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest a
|
||||
//Default값 정의
|
||||
define('DEFAULTS', [
|
||||
'DELIMITER_FILE' => "||",
|
||||
'DELIMITER_ROLE' => ",",
|
||||
'STATUS' => "default",
|
||||
'DELIMITER_ROLE' => ","
|
||||
]);
|
||||
define('MESSAGES', [
|
||||
'CREATED' => '생성되었습니다.',
|
||||
|
||||
@ -3,9 +3,8 @@
|
||||
namespace App\Controllers\CLI;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Entities\Customer\ServicePaymentEntity;
|
||||
use App\Services\Customer\ServiceItemService;
|
||||
use App\Services\Customer\ServicePaymentService;
|
||||
use App\Entities\Customer\PaymentEntity;
|
||||
use App\Entities\Customer\ServiceEntity;
|
||||
use App\Services\Customer\ServiceService;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
@ -15,8 +14,6 @@ class Payment extends BaseController
|
||||
{
|
||||
private $_db;
|
||||
private ?ServiceService $_serviceService = null;
|
||||
private ?ServiceItemService $_servicItemeService = null;
|
||||
private ?ServicePaymentService $_servicePaymentService = null;
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
parent::initController($request, $response, $logger);
|
||||
@ -29,35 +26,21 @@ class Payment extends BaseController
|
||||
}
|
||||
return $this->_serviceService;
|
||||
}
|
||||
public function getServiceItemService(): ServiceItemService
|
||||
{
|
||||
if (!$this->_servicItemeService) {
|
||||
$this->_servicItemeService = new ServiceItemService();
|
||||
}
|
||||
return $this->_servicItemeService;
|
||||
}
|
||||
public function getServicePaymentService(): ServicePaymentService
|
||||
{
|
||||
if (!$this->_servicePaymentService) {
|
||||
$this->_servicePaymentService = new ServicePaymentService();
|
||||
}
|
||||
return $this->_servicePaymentService;
|
||||
}
|
||||
public function billing(): void
|
||||
{
|
||||
//Transaction Start
|
||||
$this->_db->transStart();
|
||||
try {
|
||||
//서비스중 결제일이 오늘이고, 상태가 사용중이 경우만 서비스 모두 연장처리
|
||||
$this->getServiceService()->extendBillingAt(date('Y-m-d'), DEFAULTS['STATUS']);
|
||||
$this->getServiceService()->extendBillingAt(date('Y-m-d'), PaymentEntity::STATUS_UNPAID);
|
||||
//결제일이 오늘보다 크고, 상태가 사용중인 서비스정보를 이용해서 결제정보에 신규 추가하기
|
||||
foreach ($this->getServiceService()->getEntities(['billing_at' => date("Y-m-d"), 'status' => DEFAULTS['STATUS']]) as $serviceEntity) {
|
||||
foreach ($this->getServiceService()->getEntities(['billing_at' => date("Y-m-d"), 'status' => ServiceEntity::STATUS_NORMAL]) as $serviceEntity) {
|
||||
// echo $serviceEntity->getPK() . ":" . $serviceEntity->getBillingAt() . "\n";
|
||||
foreach ($this->getServiceItemService()->getEntities(['serviceinfo_code' => $serviceEntity->getPK()]) as $itemEntity) {
|
||||
//결제정보 ServicePaymentService에 월별 결제만 신규등록
|
||||
if ($itemEntity->getBillingCycle() == "month") {
|
||||
//결제정보 ServicePaymentService에 등록
|
||||
$paymentFormDatas = ['status' => ServicePaymentEntity::STATUS_UNPAID];
|
||||
$paymentFormDatas = ['status' => PaymentEntity::STATUS_UNPAID];
|
||||
$this->getServicePaymentService()->createByServiceItemService($paymentFormDatas, $itemEntity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,13 +4,13 @@
|
||||
"settings": {
|
||||
"width": 3000,
|
||||
"height": 3000,
|
||||
"scrollTop": -621,
|
||||
"scrollLeft": -824,
|
||||
"scrollTop": -922,
|
||||
"scrollLeft": -856,
|
||||
"zoomLevel": 1,
|
||||
"show": 511,
|
||||
"database": 4,
|
||||
"databaseName": "",
|
||||
"canvasType": "@dineug/erd-editor/builtin-schema-sql",
|
||||
"canvasType": "ERD",
|
||||
"language": 1,
|
||||
"tableNameCase": 4,
|
||||
"columnNameCase": 2,
|
||||
@ -154,6 +154,7 @@
|
||||
"02r_3OPPiD_vAgD7rmZK4",
|
||||
"Vb_CyMe0qvi7oxda4dUVW",
|
||||
"Ksp65Qh_aOFmAb1ksx64Q",
|
||||
"OlPnOq18FoBJeMCdgLLew",
|
||||
"6JNus18UqajPfwOjkPali",
|
||||
"qmfQUBHfeiJwR5kq3SyNW",
|
||||
"D1tPn8Uq5C8UWh6dtzBJZ",
|
||||
@ -171,7 +172,7 @@
|
||||
"color": ""
|
||||
},
|
||||
"meta": {
|
||||
"updateAt": 1755506752231,
|
||||
"updateAt": 1755584376751,
|
||||
"createAt": 1745819764137
|
||||
}
|
||||
},
|
||||
@ -236,7 +237,6 @@
|
||||
"m77kSp3scTgMhInPBjsc3",
|
||||
"9F6QpQqxeEggZ0FHM81O1",
|
||||
"tsDqk1dzwzUtvBzpjmarJ",
|
||||
"gf3QFUo-9exbygXX3-0H0",
|
||||
"bh-W1plz0vCW2rURDnfDR",
|
||||
"hmZlcR-Pw2C_ife1zzo5o",
|
||||
"AGBQ4FnuIDU-Dy5QoS0Fu",
|
||||
@ -308,7 +308,7 @@
|
||||
"color": ""
|
||||
},
|
||||
"meta": {
|
||||
"updateAt": 1755506924111,
|
||||
"updateAt": 1755584140872,
|
||||
"createAt": 1745819764137
|
||||
}
|
||||
},
|
||||
@ -422,7 +422,6 @@
|
||||
"6i-Ag5fvYugIDFg9tH3HA",
|
||||
"6qd6rcTkraI_AbHcVbp6T",
|
||||
"dIY_dF7qvUpTGyBwlnHjG",
|
||||
"no6h0YVHA0VJbeQ_StpfM",
|
||||
"aWjaosOJdZd4AqZ-dk69F",
|
||||
"nDoaVrEhO8hLuHbgZV4il",
|
||||
"Vm1-FnoJLcJ0GRnTp0vnn",
|
||||
@ -467,7 +466,7 @@
|
||||
"color": ""
|
||||
},
|
||||
"meta": {
|
||||
"updateAt": 1755566269693,
|
||||
"updateAt": 1755584145808,
|
||||
"createAt": 1745819764138
|
||||
}
|
||||
},
|
||||
@ -911,9 +910,9 @@
|
||||
"50a08OnwVq9SXAXX5pq6s",
|
||||
"ptLUIGfIqm89XGRz_V2ww",
|
||||
"hQ5EOPiUpDbVpWQwawtw4",
|
||||
"hK2hK1Xs1GrDW5nUTroIR",
|
||||
"9o7wfPp7WK2nZoxkDZ9Y1",
|
||||
"ualEjhI_OuUVdgH7dSzma",
|
||||
"hK2hK1Xs1GrDW5nUTroIR",
|
||||
"dl-BGTI0AsAceG9ke4f5I",
|
||||
"zI5HOW0pqDcmw_02bP4xI",
|
||||
"INFtEt_QkptcKDjuJ3lHd",
|
||||
@ -959,9 +958,10 @@
|
||||
"RpyPtXKwtu3XFr5BM61TA",
|
||||
"FJtEzmrQUsMMbrWbzr8IR",
|
||||
"hQ5EOPiUpDbVpWQwawtw4",
|
||||
"hK2hK1Xs1GrDW5nUTroIR",
|
||||
"9o7wfPp7WK2nZoxkDZ9Y1",
|
||||
"ualEjhI_OuUVdgH7dSzma",
|
||||
"hK2hK1Xs1GrDW5nUTroIR",
|
||||
"yN9rSLjIFyQNzMqzpAQMx",
|
||||
"dl-BGTI0AsAceG9ke4f5I",
|
||||
"zI5HOW0pqDcmw_02bP4xI",
|
||||
"INFtEt_QkptcKDjuJ3lHd",
|
||||
@ -979,7 +979,7 @@
|
||||
"color": ""
|
||||
},
|
||||
"meta": {
|
||||
"updateAt": 1755506755300,
|
||||
"updateAt": 1755584468390,
|
||||
"createAt": 1748485662214
|
||||
}
|
||||
},
|
||||
@ -1347,7 +1347,6 @@
|
||||
"qd1nPOkfMmY9uJDQBaaWq",
|
||||
"40EIkWvxwjrABx7ipC0Hp",
|
||||
"j21ZiY0qBmRcuzMA7ZvJ0",
|
||||
"7o3L_-cg6l5TxZjdPwP7j",
|
||||
"yJ7WRUZyPtVG_Sh9ytED6",
|
||||
"J6Q1DK6nYtjbR0gheWzY6",
|
||||
"cvcacwm-6mn2YlVM7rpSx",
|
||||
@ -1378,7 +1377,7 @@
|
||||
"color": ""
|
||||
},
|
||||
"meta": {
|
||||
"updateAt": 1755505730335,
|
||||
"updateAt": 1755584135273,
|
||||
"createAt": 1755244574868
|
||||
}
|
||||
},
|
||||
@ -1565,7 +1564,6 @@
|
||||
"l2g7xess8DY86_ZOm7Ca1",
|
||||
"mYEan5gjLS5bBthtFCc6w",
|
||||
"SioEINPlR0iyL87vqa4N-",
|
||||
"fqqyFASOLVXWIKq61Jce7",
|
||||
"NdvFKvSSsZJ3s1sEMgXzt",
|
||||
"JP9PTSr956CAPbXosCtEq",
|
||||
"kDyVwSigBBYnp_F9MyRAw"
|
||||
@ -1595,7 +1593,7 @@
|
||||
"color": ""
|
||||
},
|
||||
"meta": {
|
||||
"updateAt": 1755572612624,
|
||||
"updateAt": 1755584198146,
|
||||
"createAt": 1755476453282
|
||||
}
|
||||
},
|
||||
@ -12721,6 +12719,46 @@
|
||||
"updateAt": 1755572836632,
|
||||
"createAt": 1755572598692
|
||||
}
|
||||
},
|
||||
"OlPnOq18FoBJeMCdgLLew": {
|
||||
"id": "OlPnOq18FoBJeMCdgLLew",
|
||||
"tableId": "6ajvOCaGuXU9pzV0Y9jEi",
|
||||
"name": "amount",
|
||||
"comment": "서비스금액",
|
||||
"dataType": "INT",
|
||||
"default": "0",
|
||||
"options": 8,
|
||||
"ui": {
|
||||
"keys": 0,
|
||||
"widthName": 60,
|
||||
"widthComment": 62,
|
||||
"widthDataType": 60,
|
||||
"widthDefault": 60
|
||||
},
|
||||
"meta": {
|
||||
"updateAt": 1755584179760,
|
||||
"createAt": 1755584179759
|
||||
}
|
||||
},
|
||||
"yN9rSLjIFyQNzMqzpAQMx": {
|
||||
"id": "yN9rSLjIFyQNzMqzpAQMx",
|
||||
"tableId": "B8haiEbPc1lRBWTv1g25G",
|
||||
"name": "amount",
|
||||
"comment": "서비스금액",
|
||||
"dataType": "INT",
|
||||
"default": "0",
|
||||
"options": 8,
|
||||
"ui": {
|
||||
"keys": 0,
|
||||
"widthName": 60,
|
||||
"widthComment": 62,
|
||||
"widthDataType": 60,
|
||||
"widthDefault": 60
|
||||
},
|
||||
"meta": {
|
||||
"updateAt": 1755584368408,
|
||||
"createAt": 1755584368408
|
||||
}
|
||||
}
|
||||
},
|
||||
"relationshipEntities": {
|
||||
@ -12744,7 +12782,7 @@
|
||||
"f7_MGvRjkwL1xkCWrAgDR"
|
||||
],
|
||||
"x": 2091.7956,
|
||||
"y": 1612.8948,
|
||||
"y": 1600.8948,
|
||||
"direction": 2
|
||||
},
|
||||
"meta": {
|
||||
@ -14275,7 +14313,7 @@
|
||||
"34psXzS7RLX0sWXZyDGGf"
|
||||
],
|
||||
"x": 1297.179,
|
||||
"y": 1848.520766666667,
|
||||
"y": 1828.520766666667,
|
||||
"direction": 2
|
||||
},
|
||||
"end": {
|
||||
@ -14284,7 +14322,7 @@
|
||||
"mOdd3p43Qb4VStgr1nWHB"
|
||||
],
|
||||
"x": 1515.6117,
|
||||
"y": 1946.3055,
|
||||
"y": 1934.3055,
|
||||
"direction": 1
|
||||
},
|
||||
"meta": {
|
||||
@ -14359,7 +14397,7 @@
|
||||
"34psXzS7RLX0sWXZyDGGf"
|
||||
],
|
||||
"x": 740.179,
|
||||
"y": 1633.8541,
|
||||
"y": 1627.8541,
|
||||
"direction": 1
|
||||
},
|
||||
"end": {
|
||||
@ -14452,7 +14490,7 @@
|
||||
"3fZMQ9qB1DO8y44eJRKdt"
|
||||
],
|
||||
"x": 1297.179,
|
||||
"y": 1603.1874333333335,
|
||||
"y": 1599.1874333333335,
|
||||
"direction": 2
|
||||
},
|
||||
"meta": {
|
||||
@ -14583,7 +14621,7 @@
|
||||
"34psXzS7RLX0sWXZyDGGf"
|
||||
],
|
||||
"x": 1297.179,
|
||||
"y": 1725.8541000000002,
|
||||
"y": 1713.8541000000002,
|
||||
"direction": 2
|
||||
},
|
||||
"end": {
|
||||
@ -14592,7 +14630,7 @@
|
||||
"6i-Ag5fvYugIDFg9tH3HA"
|
||||
],
|
||||
"x": 1514.7956,
|
||||
"y": 1698.8948,
|
||||
"y": 1680.8948,
|
||||
"direction": 1
|
||||
},
|
||||
"meta": {
|
||||
@ -14611,7 +14649,7 @@
|
||||
"n7IyDCZLDqfEo49XRYtYR"
|
||||
],
|
||||
"x": 1324.2462,
|
||||
"y": 1164.1267,
|
||||
"y": 1066.1267,
|
||||
"direction": 2
|
||||
},
|
||||
"end": {
|
||||
@ -14639,7 +14677,7 @@
|
||||
"n7IyDCZLDqfEo49XRYtYR"
|
||||
],
|
||||
"x": 1324.2462,
|
||||
"y": 968.1267,
|
||||
"y": 935.4600333333333,
|
||||
"direction": 2
|
||||
},
|
||||
"end": {
|
||||
@ -14751,7 +14789,7 @@
|
||||
"34psXzS7RLX0sWXZyDGGf"
|
||||
],
|
||||
"x": 740.179,
|
||||
"y": 1817.8541,
|
||||
"y": 1799.8541,
|
||||
"direction": 1
|
||||
},
|
||||
"end": {
|
||||
@ -14760,7 +14798,7 @@
|
||||
"pcpeNmSmqH_DtbRLyaYv9"
|
||||
],
|
||||
"x": 630.9303,
|
||||
"y": 1896.3252,
|
||||
"y": 1884.3252,
|
||||
"direction": 2
|
||||
},
|
||||
"meta": {
|
||||
@ -14788,7 +14826,7 @@
|
||||
"l2g7xess8DY86_ZOm7Ca1"
|
||||
],
|
||||
"x": 2114.6117,
|
||||
"y": 1946.3055,
|
||||
"y": 1934.3055,
|
||||
"direction": 2
|
||||
},
|
||||
"meta": {
|
||||
@ -14862,7 +14900,7 @@
|
||||
"columnIds": [
|
||||
"n7IyDCZLDqfEo49XRYtYR"
|
||||
],
|
||||
"x": 924.4962,
|
||||
"x": 1057.7462,
|
||||
"y": 1262.1267,
|
||||
"direction": 8
|
||||
},
|
||||
@ -14890,9 +14928,9 @@
|
||||
"columnIds": [
|
||||
"n7IyDCZLDqfEo49XRYtYR"
|
||||
],
|
||||
"x": 1190.9962,
|
||||
"y": 1262.1267,
|
||||
"direction": 8
|
||||
"x": 1324.2462,
|
||||
"y": 1196.7933666666668,
|
||||
"direction": 2
|
||||
},
|
||||
"end": {
|
||||
"tableId": "ZLEpY5EjuZV21718zf-Y1",
|
||||
@ -14900,7 +14938,7 @@
|
||||
"ImCmrkHrB4nfB35PilQnf"
|
||||
],
|
||||
"x": 1514.7956,
|
||||
"y": 1526.8948,
|
||||
"y": 1520.8948,
|
||||
"direction": 1
|
||||
},
|
||||
"meta": {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -27,14 +27,6 @@ abstract class CommonEntity extends Entity
|
||||
$field = constant("static::TITLE");
|
||||
return $this->attributes[$field];
|
||||
}
|
||||
final public function isMatched(string $field, string $value): bool
|
||||
{
|
||||
//Helper의 getListRowColor 함수에서 사용
|
||||
if (!array_key_exists($field, $this->attributes)) {
|
||||
return true;
|
||||
};
|
||||
return $this->attributes[$field] == $value;
|
||||
}
|
||||
final public function getUpdatedAt(): string|null
|
||||
{
|
||||
return $this->attributes['updated_at'];
|
||||
|
||||
@ -10,6 +10,7 @@ class AccountEntity extends CustomerEntity
|
||||
const TITLE = AccountModel::TITLE;
|
||||
const STATUS_WIDTHDRAWAL = "widthdrawal";
|
||||
const STATUS_DEPOSIT = "deposit";
|
||||
const DEFAULT_STATUS = self::STATUS_WIDTHDRAWAL;
|
||||
//고객정보객체-상속
|
||||
//타 객체정의 부분
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ class ClientEntity extends CustomerEntity
|
||||
const STATUS_NORMAL = "normal";
|
||||
const STATUS_PAUSE = "pause";
|
||||
const STATUS_TERMINATED = "terminated";
|
||||
const DEFAULT_STATUS = self::STATUS_NORMAL;
|
||||
|
||||
//타 객체정의 부분
|
||||
public function getCode(): string
|
||||
|
||||
@ -10,7 +10,7 @@ class CouponEntity extends CustomerEntity
|
||||
const TITLE = CouponModel::TITLE;
|
||||
const STATUS_WIDTHDRAWAL = "widthdrawal";
|
||||
const STATUS_DEPOSIT = "deposit";
|
||||
|
||||
const DEFAULT_STATUS = self::STATUS_WIDTHDRAWAL;
|
||||
//고객정보객체-상속
|
||||
//타 객체정의 부분
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ class PaymentEntity extends CustomerEntity
|
||||
const TITLE = PaymentModel::TITLE;
|
||||
const STATUS_UNPAID = "unpaid";
|
||||
const STATUS_PAID = "paid";
|
||||
const DEFAULT_STATUS = self::STATUS_UNPAID; // 기본 상태는 미지급(unpaid)
|
||||
//관리자정보객체
|
||||
final public function getUserUID(): int
|
||||
{
|
||||
@ -48,7 +49,7 @@ class PaymentEntity extends CustomerEntity
|
||||
public function getCountDueAt(): string
|
||||
{
|
||||
$result = "";
|
||||
if ($this->getStatus() === DEFAULTS['STATUS']) {
|
||||
if ($this->getStatus() === self::STATUS_UNPAID) {
|
||||
$now = new DateTime(); // 오늘 날짜
|
||||
$due = new DateTime($this->getBillingAt());
|
||||
if ($due < $now) {
|
||||
|
||||
@ -10,7 +10,7 @@ class PointEntity extends CustomerEntity
|
||||
const TITLE = PointModel::TITLE;
|
||||
const STATUS_WIDTHDRAWAL = "widthdrawal";
|
||||
const STATUS_DEPOSIT = "deposit";
|
||||
|
||||
const DEFAULT_STATUS = self::STATUS_WIDTHDRAWAL;
|
||||
//고객정보객체-상속
|
||||
//타 객체정의 부분
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ class ServiceEntity extends CustomerEntity
|
||||
const STATUS_NORMAL = "normal";
|
||||
const STATUS_PAUSE = "pause";
|
||||
const STATUS_TERMINATED = "terminated";
|
||||
const DEFAULT_STATUS = self::STATUS_NORMAL;
|
||||
public function getCode(): string
|
||||
{
|
||||
return $this->attributes['code'] ?? "null";
|
||||
|
||||
@ -11,4 +11,5 @@ class CSEntity extends EquipmentEntity
|
||||
const STATUS_AVAILABLE = "available";
|
||||
const STATUS_OCCUPIED = "occupied";
|
||||
const STATUS_FORBIDDEN = "forbidden";
|
||||
const DEFAULT_STATUS = self::STATUS_AVAILABLE;
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ class IpEntity extends EquipmentEntity
|
||||
const STATUS_AVAILABLE = "available";
|
||||
const STATUS_OCCUPIED = "occupied";
|
||||
const STATUS_FORBIDDEN = "forbidden";
|
||||
const DEFAULT_STATUS = self::STATUS_AVAILABLE;
|
||||
public function getIP(): string
|
||||
{
|
||||
return $this->attributes['ip'];
|
||||
|
||||
@ -11,6 +11,7 @@ class LineEntity extends EquipmentEntity
|
||||
const STATUS_AVAILABLE = "available";
|
||||
const STATUS_OCCUPIED = "occupied";
|
||||
const STATUS_FORBIDDEN = "forbidden";
|
||||
const DEFAULT_STATUS = self::STATUS_AVAILABLE;
|
||||
public function getBandwith()
|
||||
{
|
||||
return $this->attributes['bandwith'];
|
||||
|
||||
@ -11,4 +11,5 @@ class PartEntity extends EquipmentEntity
|
||||
const STATUS_AVAILABLE = "available";
|
||||
const STATUS_OCCUPIED = "occupied";
|
||||
const STATUS_FORBIDDEN = "forbidden";
|
||||
const DEFAULT_STATUS = self::STATUS_AVAILABLE;
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ class ServerEntity extends EquipmentEntity
|
||||
const STATUS_AVAILABLE = "available";
|
||||
const STATUS_OCCUPIED = "occupied";
|
||||
const STATUS_FORBIDDEN = "forbidden";
|
||||
const DEFAULT_STATUS = self::STATUS_AVAILABLE;
|
||||
|
||||
public function getCode(): string
|
||||
{
|
||||
|
||||
@ -10,6 +10,8 @@ class SwitchEntity extends EquipmentEntity
|
||||
const TITLE = SwitchModel::TITLE;
|
||||
const STATUS_AVAILABLE = "available";
|
||||
const STATUS_OCCUPIED = "occupied";
|
||||
const STATUS_FORBIDDEN = "forbidden";
|
||||
const DEFAULT_STATUS = self::STATUS_AVAILABLE;
|
||||
|
||||
public function getCode(): string
|
||||
{
|
||||
|
||||
@ -9,7 +9,9 @@ class MyLogEntity extends CommonEntity
|
||||
{
|
||||
const PK = Model::PK;
|
||||
const TITLE = Model::TITLE;
|
||||
|
||||
const STATUS_SUCCESS = "success";
|
||||
const STATUS_FAILED = "error";
|
||||
const DEFAULT_STATUS = self::STATUS_SUCCESS;
|
||||
//공통부분
|
||||
//Common Function
|
||||
}
|
||||
|
||||
@ -10,8 +10,9 @@ class UserEntity extends CommonEntity
|
||||
const PK = Model::PK;
|
||||
const TITLE = Model::TITLE;
|
||||
const STATUS_NORMAL = "normal";
|
||||
const STATUS_OCCUPIED = "occupied";
|
||||
const STATUS_PAUSE = "pause";
|
||||
const STATUS_TERMINATED = "terminated";
|
||||
const DEFAULT_STATUS = self::STATUS_NORMAL;
|
||||
|
||||
public function getID(): string
|
||||
{
|
||||
|
||||
@ -11,7 +11,8 @@ class UserSNSEntity extends CommonEntity
|
||||
const TITLE = Model::TITLE;
|
||||
const STATUS_NORMAL = "normal";
|
||||
const STATUS_PAUSE = "pause";
|
||||
|
||||
const STATUS_TERMINATED = "terminated";
|
||||
const DEFAULT_STATUS = self::STATUS_NORMAL;
|
||||
//Common Function
|
||||
public function getParent(): int|null
|
||||
{
|
||||
|
||||
@ -331,11 +331,6 @@ class CommonHelper
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
final public function getListRowColor(mixed $entity, string $field = 'status', string $value = DEFAULTS['STATUS']): string
|
||||
{
|
||||
return $entity->isMatched($field, $value) ? "" : 'class="table-danger"';
|
||||
}
|
||||
|
||||
public function getListLabel(string $field, string $label, array $viewDatas, array $extras = []): string
|
||||
{
|
||||
switch ($field) {
|
||||
|
||||
@ -46,7 +46,7 @@ class PaymentHelper extends CustomerHelper
|
||||
$action = "";
|
||||
break;
|
||||
case 'delete':
|
||||
$action = $viewDatas['entity']->getStatus() !== DEFAULTS['STATUS'] ? "" : parent::getListButton($action, $label, $viewDatas, $extras);
|
||||
$action = $viewDatas['entity']->getStatus() !== $viewDatas['entity']::DEFAULT_STATUS ? "" : parent::getListButton($action, $label, $viewDatas, $extras);
|
||||
break;
|
||||
case 'invoice':
|
||||
$action = form_submit($action . "_submit", '청구서 발행', [
|
||||
|
||||
@ -14,10 +14,10 @@ return [
|
||||
'deleted_at' => "삭제일",
|
||||
],
|
||||
'DEFAULTS' => [
|
||||
'status' => 'default'
|
||||
'status' => 'success'
|
||||
],
|
||||
"STATUS" => [
|
||||
'default' => "완료",
|
||||
'success' => "완료",
|
||||
"fail" => "실패",
|
||||
],
|
||||
];
|
||||
|
||||
@ -67,7 +67,7 @@ abstract class GoogleSocket extends MySocket
|
||||
}
|
||||
}
|
||||
//상태가 use(승인완료)가 아니라면
|
||||
if ($entity->getStatus() !== DEFAULTS['STATUS']) {
|
||||
if ($entity->getStatus() !== $entity::DEFAULT_STATUS) {
|
||||
throw new PageNotFoundException(message: "{$entity->getSite()}의{$entity->getEmail()}:{$entity->getTitle()}님은 {$entity->status}입니다 ");
|
||||
}
|
||||
return $entity;
|
||||
|
||||
@ -15,10 +15,10 @@ class ServiceModel extends CustomerModel
|
||||
protected $allowedFields = [
|
||||
"user_uid",
|
||||
"clientinfo_code",
|
||||
"clientinfo_name",
|
||||
"type",
|
||||
"location",
|
||||
"code",
|
||||
"billing_at",
|
||||
"amount",
|
||||
"start_at",
|
||||
"end_at",
|
||||
"status",
|
||||
@ -35,9 +35,10 @@ class ServiceModel extends CustomerModel
|
||||
}
|
||||
switch ($field) {
|
||||
case "user_uid":
|
||||
case "clientinfo_code":
|
||||
case "amount":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
case "clientinfo_code":
|
||||
case "location":
|
||||
case "status":
|
||||
$rule = "required|trim|string";
|
||||
|
||||
@ -30,7 +30,7 @@ class LocalService extends AuthService
|
||||
|
||||
public function login(array $formDatas): UserEntity
|
||||
{
|
||||
$entity = $this->getEntity(['id' => $formDatas['id'], 'status' => DEFAULTS['STATUS']], false);
|
||||
$entity = $this->getEntity(['id' => $formDatas['id'], 'status' => UserEntity::DEFAULT_STATUS], false);
|
||||
if (!$entity) {
|
||||
throw new \Exception("{$formDatas['id']}에 대한 로그인 정보를 찾을수 없습니다.");
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ class AccountService extends CustomerService
|
||||
}
|
||||
$amount = intval($formDatas['amount']);
|
||||
// dd($formDatas);
|
||||
if ($formDatas['status'] === DEFAULTS['STATUS']) { //입금, 쿠폰추가
|
||||
if ($formDatas['status'] === AccountEntity::DEFAULT_STATUS) { //입금, 쿠폰추가
|
||||
$entity = $this->getClientService()->deposit($entity, 'account_balance', $amount);
|
||||
} else { // 출금, 쿠폰사용
|
||||
$entity = $this->getClientService()->withdrawal($entity, 'account_balance', $amount);
|
||||
|
||||
@ -41,7 +41,7 @@ class CouponService extends CustomerService
|
||||
throw new \Exception("{$formDatas['clientinfo_code']}에 대한 고객정보를 찾을수 없습니다.");
|
||||
}
|
||||
$amount = intval($formDatas['amount']);
|
||||
if ($formDatas['status'] === DEFAULTS['STATUS']) { //입금, 쿠폰추가
|
||||
if ($formDatas['status'] === CouponEntity::DEFAULT_STATUS) { //입금, 쿠폰추가
|
||||
$entity = $this->getClientService()->deposit($entity, 'coupon_balance', $amount);
|
||||
} else { // 출금, 쿠폰사용
|
||||
$entity = $this->getClientService()->withdrawal($entity, 'coupon_balance', $amount);
|
||||
|
||||
@ -80,7 +80,7 @@ class PaymentService extends CustomerService
|
||||
$sql = sprintf("SELECT serviceinfo_code,COUNT(*) as CNT
|
||||
FROM payment
|
||||
WHERE billing_at < NOW() AND amount > 0 AND status = '%s'
|
||||
GROUP BY serviceinfo_code", DEFAULTS['STATUS']);
|
||||
GROUP BY serviceinfo_code", PaymentEntity::DEFAULT_STATUS);
|
||||
$unpaids = [];
|
||||
foreach ($this->getModel()->query($sql)->getResult() as $row) {
|
||||
$unpaids[$row->serverinfo_code] = $row->CNT;
|
||||
|
||||
@ -40,7 +40,7 @@ class PointService extends CustomerService
|
||||
throw new \Exception("{$formDatas['clientinfo_code']}에 대한 고객정보를 찾을수 없습니다.");
|
||||
}
|
||||
$amount = intval($formDatas['amount']);
|
||||
if ($formDatas['status'] === DEFAULTS['STATUS']) { //입금, 쿠폰추가
|
||||
if ($formDatas['status'] === PointEntity::DEFAULT_STATUS) { //입금, 쿠폰추가
|
||||
$entity = $this->getClientService()->deposit($entity, 'point_balance', $amount);
|
||||
} else { // 출금, 쿠폰사용
|
||||
$entity = $this->getClientService()->withdrawal($entity, 'point_balance', $amount);
|
||||
|
||||
@ -17,22 +17,26 @@ class ServiceService extends CustomerService
|
||||
{
|
||||
return [
|
||||
"clientinfo_code",
|
||||
"type",
|
||||
"location",
|
||||
"billing_at",
|
||||
"amount",
|
||||
"start_at",
|
||||
"status"
|
||||
"end_at",
|
||||
"status",
|
||||
];
|
||||
}
|
||||
public function getFilterFields(): array
|
||||
{
|
||||
return ["user_uid", "clientinfo_code", 'status'];
|
||||
return ['clientinfo_code', 'type', 'location', 'status'];
|
||||
}
|
||||
public function getBatchJobFields(): array
|
||||
{
|
||||
return ['status'];
|
||||
return ['clientinfo_code', 'status'];
|
||||
}
|
||||
public function getIndexFields(): array
|
||||
{
|
||||
return ['clientinfo_code', 'type', 'location', 'billing_at', 'start_at', 'updated_at', 'status', 'user_uid'];
|
||||
return ['clientinfo_code', 'type', 'location', 'billing_at', 'amount', 'start_at', 'end_at', 'updated_at', 'status', 'user_uid'];
|
||||
}
|
||||
//Entity의 관련객체정의용
|
||||
public function setSearchIp(string $ip): void
|
||||
@ -73,7 +77,7 @@ class ServiceService extends CustomerService
|
||||
return $options;
|
||||
}
|
||||
//interval을 기준으로 최근 신규 서비스정보 가져오기
|
||||
final public function getEntitiesByNewService(int $interval, string $status = DEFAULTS['STATUS']): array
|
||||
final public function getEntitiesByNewService(int $interval, string $status = ServiceEntity::DEFAULT_STATUS): array
|
||||
{
|
||||
return $this->getEntities(sprintf("start_at >= NOW()-INTERVAL {$interval} DAY AND status = '%s'", $status));
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ class IpService extends EquipmentService
|
||||
$formDatas = [
|
||||
'lineinfo_uid' => $entity->getPK(),
|
||||
'ip' => $ip,
|
||||
'status' => DEFAULTS['STATUS'],
|
||||
'status' => IpEntity::DEFAULT_STATUS,
|
||||
];
|
||||
return $this->create($formDatas);
|
||||
}
|
||||
|
||||
@ -26,13 +26,12 @@
|
||||
<th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['helper']->getListLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
|
||||
<?php endforeach ?>
|
||||
<th class="index_head_short_column">작업</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $cnt = 0 ?>
|
||||
<?php foreach ($viewDatas['entities'] as $entity): ?>
|
||||
<?php $viewDatas['entity'] = $entity; ?>
|
||||
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
|
||||
<tr <?= $viewDatas['entity']->getStatus() === $viewDatas['entity']::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
|
||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||
<td nowrap><?= $viewDatas['helper']->getListButton('modify', '', $viewDatas) ?></td>
|
||||
<?php foreach ($viewDatas['control']['index_fields'] as $field): ?>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<?php $cnt = 0 ?>
|
||||
<?php foreach ($viewDatas['entities'] as $entity): ?>
|
||||
<?php $viewDatas['entity'] = $entity; ?>
|
||||
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
|
||||
<tr <?= $viewDatas['entity']->getStatus() === $viewDatas['entity']::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
|
||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||
<td nowrap><?= $viewDatas['helper']->getListButton('modify', '', $viewDatas) ?></td>
|
||||
<?php foreach ($viewDatas['control']['index_fields'] as $field): ?>
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
<?php $cnt = 0 ?>
|
||||
<?php foreach ($viewDatas['entities'] as $entity): ?>
|
||||
<?php $viewDatas['entity'] = $entity; ?>
|
||||
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
|
||||
<tr <?= $viewDatas['entity']->getStatus() === $viewDatas['entity']::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
|
||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||
<td nowrap><?= $viewDatas['helper']->getListButton('modify', '', $viewDatas) ?></td>
|
||||
<?php foreach ($viewDatas['control']['index_fields'] as $field): ?>
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
<?php $cnt = 0 ?>
|
||||
<?php foreach ($viewDatas['entities'] as $entity): ?>
|
||||
<?php $viewDatas['entity'] = $entity; ?>
|
||||
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
|
||||
<tr <?= $viewDatas['entity']->getStatus() === $viewDatas['entity']::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
|
||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||
<td nowrap><?= $viewDatas['helper']->getListButton('modify', '', $viewDatas) ?></td>
|
||||
<?php foreach ($viewDatas['control']['index_fields'] as $field): ?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user