diff --git a/app/Config/Pager.php b/app/Config/Pager.php index e341f4d..994cd86 100644 --- a/app/Config/Pager.php +++ b/app/Config/Pager.php @@ -24,6 +24,8 @@ class Pager extends BaseConfig 'default_full' => 'CodeIgniter\Pager\Views\default_full', 'default_simple' => 'CodeIgniter\Pager\Views\default_simple', 'default_head' => 'CodeIgniter\Pager\Views\default_head', + 'bootstrap_full' => 'Pagers/bootstrap_full', + 'bootstrap_simple' => 'Pagers/bootstrap_simple', ]; /** diff --git a/app/Config/Services.php b/app/Config/Services.php index 0f26514..90bef92 100644 --- a/app/Config/Services.php +++ b/app/Config/Services.php @@ -37,7 +37,7 @@ class Services extends BaseService if ($getShared) { return static::getSharedInstance('myauth'); } else { - return new LocalService(new UserModel()); + return new LocalService(); } } } diff --git a/app/Database/dbmsv2.vuerd.json b/app/Database/dbmsv2.vuerd.json index 0548982..94e8cbd 100644 --- a/app/Database/dbmsv2.vuerd.json +++ b/app/Database/dbmsv2.vuerd.json @@ -4,8 +4,8 @@ "settings": { "width": 3000, "height": 3000, - "scrollTop": -417.4401, - "scrollLeft": -1101, + "scrollTop": -1476.4401, + "scrollLeft": -1039, "zoomLevel": 0.73, "show": 511, "database": 4, @@ -71,7 +71,8 @@ "uTwhO_6djzNzMFo8rwOSQ", "FjAORncWifI_a1aI6e0LJ", "qVSQf-uiaof7exFrBC68_", - "TkraffhuWi06www9bNecX" + "TkraffhuWi06www9bNecX", + "JHk1wOfFhz_GNJAEenhCO" ], "indexIds": [], "memoIds": [] @@ -108,15 +109,15 @@ "w_EuwbTwtLEPAgYjS1aYq" ], "ui": { - "x": 1128.6512, - "y": 85.2874, + "x": 1282.0761, + "y": 77.0685, "zIndex": 2, "widthName": 60, "widthComment": 62, "color": "" }, "meta": { - "updateAt": 1755480211458, + "updateAt": 1755500339536, "createAt": 1745819764136 } }, @@ -165,15 +166,15 @@ "JEk5AASiK6MpT9QBRWjMX" ], "ui": { - "x": 1285.73, - "y": 468.8448, + "x": 1073.4011, + "y": 509.9413, "zIndex": 2, "widthName": 60, "widthComment": 60, "color": "" }, "meta": { - "updateAt": 1755483290342, + "updateAt": 1755500463714, "createAt": 1745819764137 } }, @@ -233,12 +234,15 @@ "comment": "서버정보", "columnIds": [ "34psXzS7RLX0sWXZyDGGf", + "hPz83FX0cU7HIyVRRr5sl", "3fZMQ9qB1DO8y44eJRKdt", + "m77kSp3scTgMhInPBjsc3", "9F6QpQqxeEggZ0FHM81O1", "tsDqk1dzwzUtvBzpjmarJ", "gf3QFUo-9exbygXX3-0H0", "bh-W1plz0vCW2rURDnfDR", "hmZlcR-Pw2C_ife1zzo5o", + "AGBQ4FnuIDU-Dy5QoS0Fu", "tNaVOzr3vywCXiQdfUJWq", "6bQ_6eGfINic9LpM6PtDw", "X-NZLAAPpv21iBJTwymIG" @@ -260,7 +264,9 @@ "SlbGqJXf-rNePjMEvRIsr", "34psXzS7RLX0sWXZyDGGf", "1R3FQnBR2tpSdfkj3jipU", + "hPz83FX0cU7HIyVRRr5sl", "3fZMQ9qB1DO8y44eJRKdt", + "m77kSp3scTgMhInPBjsc3", "9F6QpQqxeEggZ0FHM81O1", "EKrwHre6e66jqAMnAW_KR", "Z2CriPHsk4OV0AD1jAhM4", @@ -284,6 +290,7 @@ "gf3QFUo-9exbygXX3-0H0", "bh-W1plz0vCW2rURDnfDR", "hmZlcR-Pw2C_ife1zzo5o", + "AGBQ4FnuIDU-Dy5QoS0Fu", "tNaVOzr3vywCXiQdfUJWq", "6bQ_6eGfINic9LpM6PtDw", "yjaoHnd4nFaa-3REXvRfN", @@ -296,15 +303,15 @@ "aY2pn1J3VHF_qV5XFM_zf" ], "ui": { - "x": 71.5172, - "y": 1835.6074, + "x": 60.5584, + "y": 1752.0458, "zIndex": 2, "widthName": 60, "widthComment": 60, "color": "" }, "meta": { - "updateAt": 1755481695626, + "updateAt": 1755501272583, "createAt": 1745819764137 } }, @@ -872,15 +879,15 @@ "n9ZWAQ9754sZ3MM4IxCAA" ], "ui": { - "x": 2122.464, - "y": 225.9575, + "x": 2244.3818, + "y": 254.7248, "zIndex": 2278, "widthName": 88, "widthComment": 74, "color": "" }, "meta": { - "updateAt": 1755483363450, + "updateAt": 1755500487034, "createAt": 1748484896313 } }, @@ -955,15 +962,15 @@ "2fzVlWt1Skh-391N_z9Ci" ], "ui": { - "x": 883.3029, - "y": 1018.5867, + "x": 1161.3852, + "y": 1013.1073, "zIndex": 2395, "widthName": 60, "widthComment": 62, "color": "" }, "meta": { - "updateAt": 1755488809590, + "updateAt": 1755500473840, "createAt": 1748485662214 } }, @@ -1307,15 +1314,15 @@ "4WVshk8-9asWSnI26Uvp7" ], "ui": { - "x": 2134.0658, - "y": 642.3421, + "x": 2258.7233, + "y": 828.6435, "zIndex": 3908, "widthName": 97, "widthComment": 86, "color": "" }, "meta": { - "updateAt": 1755483389664, + "updateAt": 1755500481452, "createAt": 1755230026191 } }, @@ -1355,14 +1362,14 @@ ], "ui": { "x": 1038.6154, - "y": 1991.4485, + "y": 2003.7774, "zIndex": 4045, "widthName": 60, "widthComment": 201, "color": "" }, "meta": { - "updateAt": 1755488482892, + "updateAt": 1755501009592, "createAt": 1755244574868 } }, @@ -1549,6 +1556,7 @@ "l2g7xess8DY86_ZOm7Ca1", "SioEINPlR0iyL87vqa4N-", "fqqyFASOLVXWIKq61Jce7", + "-_Sw6ye2kmchPshsVZG0Q", "NdvFKvSSsZJ3s1sEMgXzt", "JP9PTSr956CAPbXosCtEq", "kDyVwSigBBYnp_F9MyRAw" @@ -1562,21 +1570,22 @@ "l2g7xess8DY86_ZOm7Ca1", "SioEINPlR0iyL87vqa4N-", "fqqyFASOLVXWIKq61Jce7", + "-_Sw6ye2kmchPshsVZG0Q", "NdvFKvSSsZJ3s1sEMgXzt", "e65_vbZsM9k8Cn5lwGjt5", "JP9PTSr956CAPbXosCtEq", "kDyVwSigBBYnp_F9MyRAw" ], "ui": { - "x": 1041.4963, - "y": 2358.8691, + "x": 1042.8662, + "y": 2365.7186, "zIndex": 4514, "widthName": 101, "widthComment": 165, "color": "" }, "meta": { - "updateAt": 1755488502651, + "updateAt": 1755500759882, "createAt": 1755476453282 } }, @@ -11247,7 +11256,7 @@ "id": "SioEINPlR0iyL87vqa4N-", "tableId": "8GYAVBvZGaMFeq3QuXk_B", "name": "cnt", - "comment": "cpu 갯수", + "comment": "갯수", "dataType": "TINYINT", "default": "1", "options": 8, @@ -11259,7 +11268,7 @@ "widthDefault": 60 }, "meta": { - "updateAt": 1755476594230, + "updateAt": 1755500719132, "createAt": 1755476517788 } }, @@ -12462,6 +12471,86 @@ "updateAt": 1755488709733, "createAt": 1755488700401 } + }, + "hPz83FX0cU7HIyVRRr5sl": { + "id": "hPz83FX0cU7HIyVRRr5sl", + "tableId": "B4qGh3KZsXHQ3_4EOgwJZ", + "name": "clientinfo_code", + "comment": "고객코드(소유주)", + "dataType": "VARCHAR(20)", + "default": "", + "options": 0, + "ui": { + "keys": 2, + "widthName": 82, + "widthComment": 93, + "widthDataType": 75, + "widthDefault": 60 + }, + "meta": { + "updateAt": 1755500842421, + "createAt": 1755500407931 + } + }, + "-_Sw6ye2kmchPshsVZG0Q": { + "id": "-_Sw6ye2kmchPshsVZG0Q", + "tableId": "8GYAVBvZGaMFeq3QuXk_B", + "name": "isOnetime", + "comment": "일회성여부", + "dataType": "TINYINT", + "default": "0", + "options": 8, + "ui": { + "keys": 0, + "widthName": 60, + "widthComment": 62, + "widthDataType": 60, + "widthDefault": 60 + }, + "meta": { + "updateAt": 1755501570274, + "createAt": 1755500681880 + } + }, + "m77kSp3scTgMhInPBjsc3": { + "id": "m77kSp3scTgMhInPBjsc3", + "tableId": "B4qGh3KZsXHQ3_4EOgwJZ", + "name": "type", + "comment": "구분(밴더등)", + "dataType": "VARCHAR(20)", + "default": "", + "options": 8, + "ui": { + "keys": 0, + "widthName": 60, + "widthComment": 69, + "widthDataType": 75, + "widthDefault": 60 + }, + "meta": { + "updateAt": 1755501214243, + "createAt": 1755501057206 + } + }, + "AGBQ4FnuIDU-Dy5QoS0Fu": { + "id": "AGBQ4FnuIDU-Dy5QoS0Fu", + "tableId": "B4qGh3KZsXHQ3_4EOgwJZ", + "name": "format_at", + "comment": "포맷보류일", + "dataType": "TIMESTAMP", + "default": "", + "options": 0, + "ui": { + "keys": 0, + "widthName": 60, + "widthComment": 62, + "widthDataType": 65, + "widthDefault": 60 + }, + "meta": { + "updateAt": 1755501317431, + "createAt": 1755501262488 + } } }, "relationshipEntities": { @@ -12503,8 +12592,8 @@ "columnIds": [ "mfHtgzc_Aeocr6xkgwYWh" ], - "x": 1254.4012, - "y": 381.2874, + "x": 1659.3261, + "y": 373.0685, "direction": 8 }, "end": { @@ -12512,8 +12601,8 @@ "columnIds": [ "Vf3bNvvEPfu1zCs4rcHTU" ], - "x": 1081.5529000000001, - "y": 1018.5867, + "x": 1756.1352, + "y": 1013.1073, "direction": 4 }, "meta": { @@ -12531,8 +12620,8 @@ "columnIds": [ "mfHtgzc_Aeocr6xkgwYWh" ], - "x": 1631.6512, - "y": 159.2874, + "x": 1785.0761, + "y": 151.0685, "direction": 2 }, "end": { @@ -12540,8 +12629,8 @@ "columnIds": [ "s1Az-lXWK0NlVQqFEEK8o" ], - "x": 2122.464, - "y": 279.29083333333335, + "x": 2244.3818, + "y": 308.05813333333333, "direction": 1 }, "meta": { @@ -12559,8 +12648,8 @@ "columnIds": [ "mfHtgzc_Aeocr6xkgwYWh" ], - "x": 1128.6512, - "y": 122.2874, + "x": 1282.0761, + "y": 114.0685, "direction": 1 }, "end": { @@ -12783,8 +12872,8 @@ "columnIds": [ "mfHtgzc_Aeocr6xkgwYWh" ], - "x": 1505.9012, - "y": 381.2874, + "x": 1407.8261, + "y": 373.0685, "direction": 8 }, "end": { @@ -12792,8 +12881,8 @@ "columnIds": [ "hrPg0uHAdEjamOj--BVzO" ], - "x": 1552.23, - "y": 468.8448, + "x": 1339.9011, + "y": 509.9413, "direction": 4 }, "meta": { @@ -12811,8 +12900,8 @@ "columnIds": [ "mfHtgzc_Aeocr6xkgwYWh" ], - "x": 1128.6512, - "y": 196.2874, + "x": 1282.0761, + "y": 188.0685, "direction": 1 }, "end": { @@ -12867,8 +12956,8 @@ "columnIds": [ "mfHtgzc_Aeocr6xkgwYWh" ], - "x": 1128.6512, - "y": 270.2874, + "x": 1282.0761, + "y": 262.0685, "direction": 1 }, "end": { @@ -13175,8 +13264,8 @@ "columnIds": [ "mfHtgzc_Aeocr6xkgwYWh" ], - "x": 1631.6512, - "y": 307.2874, + "x": 1785.0761, + "y": 299.0685, "direction": 2 }, "end": { @@ -13184,8 +13273,8 @@ "columnIds": [ "ShxQXt7QhnuRrZToBBUCA" ], - "x": 2134.0658, - "y": 695.6754333333332, + "x": 2258.7233, + "y": 881.9768333333333, "direction": 1 }, "meta": { @@ -13959,8 +14048,8 @@ "columnIds": [ "1ZM86qoxmCcoKnqOpE2oj" ], - "x": 1676.3029000000001, - "y": 1312.5866999999998, + "x": 1954.3852, + "y": 1307.1073000000001, "direction": 2 }, "end": { @@ -13968,8 +14057,8 @@ "columnIds": [ "VUPZdWS7fM1J2QstRq4KR" ], - "x": 2134.0658, - "y": 909.0087666666665, + "x": 2258.7233, + "y": 1095.3101666666666, "direction": 1 }, "meta": { @@ -13987,8 +14076,8 @@ "columnIds": [ "1ZM86qoxmCcoKnqOpE2oj" ], - "x": 1676.3029000000001, - "y": 1116.5866999999998, + "x": 1954.3852, + "y": 1111.1073000000001, "direction": 2 }, "end": { @@ -13996,8 +14085,8 @@ "columnIds": [ "LRN5qjIRZ18UOhqFbBLuo" ], - "x": 2122.464, - "y": 492.6241666666667, + "x": 2244.3818, + "y": 521.3914666666667, "direction": 1 }, "meta": { @@ -14015,8 +14104,8 @@ "columnIds": [ "34psXzS7RLX0sWXZyDGGf" ], - "x": 597.5172, - "y": 2102.0074000000004, + "x": 617.5584, + "y": 2089.379133333333, "direction": 2 }, "end": { @@ -14024,8 +14113,8 @@ "columnIds": [ "mOdd3p43Qb4VStgr1nWHB" ], - "x": 1041.4963, - "y": 2482.8691, + "x": 1042.8662, + "y": 2501.7186, "direction": 1 }, "meta": { @@ -14099,8 +14188,8 @@ "columnIds": [ "34psXzS7RLX0sWXZyDGGf" ], - "x": 597.5172, - "y": 1924.4074000000003, + "x": 617.5584, + "y": 1905.3791333333331, "direction": 2 }, "end": { @@ -14183,8 +14272,8 @@ "columnIds": [ "1ZM86qoxmCcoKnqOpE2oj" ], - "x": 883.3029, - "y": 1214.5866999999998, + "x": 1161.3852, + "y": 1209.1073000000001, "direction": 1 }, "end": { @@ -14192,8 +14281,8 @@ "columnIds": [ "3fZMQ9qB1DO8y44eJRKdt" ], - "x": 597.5172, - "y": 1865.2074000000002, + "x": 617.5584, + "y": 1844.0457999999999, "direction": 2 }, "meta": { @@ -14323,8 +14412,8 @@ "columnIds": [ "34psXzS7RLX0sWXZyDGGf" ], - "x": 597.5172, - "y": 1983.6074000000003, + "x": 617.5584, + "y": 1966.7124666666664, "direction": 2 }, "end": { @@ -14351,8 +14440,8 @@ "columnIds": [ "n7IyDCZLDqfEo49XRYtYR" ], - "x": 1552.23, - "y": 860.8448000000001, + "x": 1473.1511, + "y": 901.9413, "direction": 8 }, "end": { @@ -14360,8 +14449,8 @@ "columnIds": [ "0LanT5cVJX_uBb0Foh2NM" ], - "x": 1478.0529000000001, - "y": 1018.5867, + "x": 1359.6352, + "y": 1013.1073, "direction": 4 }, "meta": { @@ -14379,8 +14468,8 @@ "columnIds": [ "n7IyDCZLDqfEo49XRYtYR" ], - "x": 1818.73, - "y": 566.8448000000001, + "x": 1606.4011, + "y": 607.9413, "direction": 2 }, "end": { @@ -14388,8 +14477,8 @@ "columnIds": [ "QwfRq6xU7Vy-QoenynjXR" ], - "x": 2122.464, - "y": 385.95750000000004, + "x": 2244.3818, + "y": 414.7248, "direction": 1 }, "meta": { @@ -14407,8 +14496,8 @@ "columnIds": [ "n7IyDCZLDqfEo49XRYtYR" ], - "x": 1818.73, - "y": 762.8448000000001, + "x": 1606.4011, + "y": 803.9413, "direction": 2 }, "end": { @@ -14416,8 +14505,8 @@ "columnIds": [ "VBy1PXlflYSQGeLRXkD3l" ], - "x": 2134.0658, - "y": 802.3420999999998, + "x": 2258.7233, + "y": 988.6434999999999, "direction": 1 }, "meta": { @@ -14435,8 +14524,8 @@ "columnIds": [ "n7IyDCZLDqfEo49XRYtYR" ], - "x": 1285.73, - "y": 534.1781333333333, + "x": 1073.4011, + "y": 575.2746333333333, "direction": 1 }, "end": { @@ -14463,8 +14552,8 @@ "columnIds": [ "n7IyDCZLDqfEo49XRYtYR" ], - "x": 1285.73, - "y": 664.8448, + "x": 1073.4011, + "y": 705.9413, "direction": 1 }, "end": { @@ -14491,8 +14580,8 @@ "columnIds": [ "34psXzS7RLX0sWXZyDGGf" ], - "x": 597.5172, - "y": 2042.8074000000004, + "x": 617.5584, + "y": 2028.0457999999996, "direction": 2 }, "end": { @@ -14501,7 +14590,7 @@ "pcpeNmSmqH_DtbRLyaYv9" ], "x": 1038.6154, - "y": 2163.4485, + "y": 2175.7774, "direction": 1 }, "meta": { @@ -14528,8 +14617,8 @@ "columnIds": [ "l2g7xess8DY86_ZOm7Ca1" ], - "x": 1597.4963, - "y": 2482.8691, + "x": 1598.8662, + "y": 2501.7186, "direction": 2 }, "meta": { @@ -14547,8 +14636,8 @@ "columnIds": [ "mfHtgzc_Aeocr6xkgwYWh" ], - "x": 1128.6512, - "y": 344.2874, + "x": 1282.0761, + "y": 336.0685, "direction": 1 }, "end": { @@ -14575,8 +14664,8 @@ "columnIds": [ "n7IyDCZLDqfEo49XRYtYR" ], - "x": 1285.73, - "y": 795.5114666666666, + "x": 1073.4011, + "y": 836.6079666666666, "direction": 1 }, "end": { @@ -14592,6 +14681,34 @@ "updateAt": 1755488700401, "createAt": 1755488700401 } + }, + "JHk1wOfFhz_GNJAEenhCO": { + "id": "JHk1wOfFhz_GNJAEenhCO", + "identification": false, + "relationshipType": 16, + "startRelationshipType": 1, + "start": { + "tableId": "6ajvOCaGuXU9pzV0Y9jEi", + "columnIds": [ + "n7IyDCZLDqfEo49XRYtYR" + ], + "x": 1206.6511, + "y": 901.9413, + "direction": 8 + }, + "end": { + "tableId": "B4qGh3KZsXHQ3_4EOgwJZ", + "columnIds": [ + "hPz83FX0cU7HIyVRRr5sl" + ], + "x": 617.5584, + "y": 1782.7124666666666, + "direction": 2 + }, + "meta": { + "updateAt": 1755500407934, + "createAt": 1755500407934 + } } }, "indexEntities": {}, diff --git a/app/Entities/Equipment/IpEntity.php b/app/Entities/Equipment/IpEntity.php index 8ee0b30..18d670f 100644 --- a/app/Entities/Equipment/IpEntity.php +++ b/app/Entities/Equipment/IpEntity.php @@ -4,7 +4,7 @@ namespace App\Entities\Equipment; use App\Models\Equipment\IpModel; -class IpEntity extends PartEntity +class IpEntity extends EquipmentEntity { const PK = IpModel::PK; const TITLE = IpModel::TITLE; diff --git a/app/Entities/Equipment/LineEntity.php b/app/Entities/Equipment/LineEntity.php new file mode 100644 index 0000000..c149377 --- /dev/null +++ b/app/Entities/Equipment/LineEntity.php @@ -0,0 +1,16 @@ +attributes['bandwith']; + } +} diff --git a/app/Helpers/CommonHelper.php b/app/Helpers/CommonHelper.php index 7f1fed6..7a82f55 100644 --- a/app/Helpers/CommonHelper.php +++ b/app/Helpers/CommonHelper.php @@ -362,7 +362,7 @@ class CommonHelper // echo current_url() . '/' . $action . '?' . $viewDatas['uri']->getQuery(); $extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras]; $action = form_label( - $label ? $label : ICONS['ADD'], + $label ? $label : '입력', $action, [ "data-src" => current_url() . '/' . $action . '?' . $viewDatas['uri']->getQuery(), diff --git a/app/Language/en/Equipment/Server.php b/app/Language/en/Equipment/Server.php index 99c6a50..0f72f35 100644 --- a/app/Language/en/Equipment/Server.php +++ b/app/Language/en/Equipment/Server.php @@ -2,9 +2,11 @@ return [ 'title' => "서버장비정보", 'label' => [ - 'model' => "모델", - 'price' => "금액", - 'description' => "설명", + 'code' => "장비번호", + 'title' => "모델", + 'price' => "기본금액", + 'amount' => "서비스금액", + 'manufactur_at' => "입고일", 'status' => "상태", 'updated_at' => "수정일", 'created_at' => "작성일", diff --git a/app/Models/CommonModel.php b/app/Models/CommonModel.php index 2efcee9..eb2b066 100644 --- a/app/Models/CommonModel.php +++ b/app/Models/CommonModel.php @@ -10,7 +10,7 @@ abstract class CommonModel extends Model protected $table = ''; protected $primaryKey = ''; protected $useAutoIncrement = true; - protected $returnType = 'array'; + // protected $returnType = 'array'; protected $useSoftDeletes = false; protected $protectFields = true; protected $allowedFields = []; diff --git a/app/Models/Customer/AccountModel.php b/app/Models/Customer/AccountModel.php index 7c3ecf9..802be0e 100644 --- a/app/Models/Customer/AccountModel.php +++ b/app/Models/Customer/AccountModel.php @@ -11,6 +11,7 @@ class AccountModel extends CustomerModel const TITLE = "title"; protected $table = self::TABLE; protected $primaryKey = self::PK; + protected $returnType = AccountEntity::class; protected $allowedFields = [ "clientinfo_uid", "status", @@ -22,7 +23,6 @@ class AccountModel extends CustomerModel public function __construct() { parent::__construct(); - $this->returnType = AccountEntity::class; } public function getFormFieldRule(string $action, string $field): string { diff --git a/app/Models/Customer/ClientModel.php b/app/Models/Customer/ClientModel.php index cb66381..0cee11c 100644 --- a/app/Models/Customer/ClientModel.php +++ b/app/Models/Customer/ClientModel.php @@ -7,10 +7,11 @@ use App\Entities\Customer\ClientEntity; class ClientModel extends CustomerModel { const TABLE = "clientinfo"; - const PK = "uid"; + const PK = "code"; const TITLE = "name"; protected $table = self::TABLE; protected $primaryKey = self::PK; + protected $returnType = ClientEntity::class; protected $allowedFields = [ "code", "name", @@ -26,7 +27,6 @@ class ClientModel extends CustomerModel public function __construct() { parent::__construct(); - $this->returnType = ClientEntity::class; } public function getFormFieldRule(string $action, string $field): string { @@ -34,6 +34,10 @@ class ClientModel extends CustomerModel throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true)); } switch ($field) { + case $this->getPKField(): + $rule = "required|trim|min_length[4]|max_length[20]"; + $rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : ""; + break; case "name": $rule = "required|trim|string"; $rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : ""; @@ -41,9 +45,6 @@ class ClientModel extends CustomerModel case "role": $rule = "required|trim|string"; break; - case "code": - $rule = "if_exist|trim|string"; - break; case "email": $rule = "if_exist|trim|valid_email"; break; diff --git a/app/Models/Customer/CouponModel.php b/app/Models/Customer/CouponModel.php index 159900a..96beb69 100644 --- a/app/Models/Customer/CouponModel.php +++ b/app/Models/Customer/CouponModel.php @@ -11,6 +11,7 @@ class CouponModel extends CustomerModel const TITLE = "title"; protected $table = self::TABLE; protected $primaryKey = self::PK; + protected $returnType = CouponEntity::class; protected $allowedFields = [ "clientinfo_uid", "status", @@ -21,7 +22,6 @@ class CouponModel extends CustomerModel public function __construct() { parent::__construct(); - $this->returnType = CouponEntity::class; } public function getFormFieldRule(string $action, string $field): string { diff --git a/app/Models/Customer/PointModel.php b/app/Models/Customer/PointModel.php index a6da1a8..faa32a2 100644 --- a/app/Models/Customer/PointModel.php +++ b/app/Models/Customer/PointModel.php @@ -11,6 +11,7 @@ class PointModel extends CustomerModel const TITLE = "title"; protected $table = self::TABLE; protected $primaryKey = self::PK; + protected $returnType = PointEntity::class; protected $allowedFields = [ "clientinfo_uid", "status", @@ -21,7 +22,6 @@ class PointModel extends CustomerModel public function __construct() { parent::__construct(); - $this->returnType = PointEntity::class; } public function getFormFieldRule(string $action, string $field): string { diff --git a/app/Models/Customer/ServiceModel.php b/app/Models/Customer/ServiceModel.php index 7fb8708..ee7ea0e 100644 --- a/app/Models/Customer/ServiceModel.php +++ b/app/Models/Customer/ServiceModel.php @@ -11,6 +11,7 @@ class ServiceModel extends CustomerModel const TITLE = "code"; protected $table = self::TABLE; protected $primaryKey = self::PK; + protected $returnType = ServiceEntity::class; protected $allowedFields = [ "user_uid", "clientinfo_uid", @@ -26,7 +27,6 @@ class ServiceModel extends CustomerModel public function __construct() { parent::__construct(); - $this->returnType = ServiceEntity::class; } public function getFormFieldRule(string $action, string $field): string { diff --git a/app/Models/Customer/ServicePaymentModel.php b/app/Models/Customer/ServicePaymentModel.php index b60ccb9..7fa5916 100644 --- a/app/Models/Customer/ServicePaymentModel.php +++ b/app/Models/Customer/ServicePaymentModel.php @@ -12,6 +12,7 @@ class ServicePaymentModel extends CustomerModel const TITLE = "item_type"; protected $table = self::TABLE; protected $primaryKey = self::PK; + protected $returnType = ServicePaymentEntity::class; protected $allowedFields = [ "serviceinfo_uid", "ownerinfo_uid", @@ -28,7 +29,6 @@ class ServicePaymentModel extends CustomerModel public function __construct() { parent::__construct(); - $this->returnType = ServicePaymentEntity::class; } public function getFormFieldRule(string $action, string $field): string { diff --git a/app/Models/Equipment/CSModel.php b/app/Models/Equipment/CSModel.php index 9c94d4e..5adf75b 100644 --- a/app/Models/Equipment/CSModel.php +++ b/app/Models/Equipment/CSModel.php @@ -11,6 +11,7 @@ class CSModel extends EquipmentModel const TITLE = "ip"; protected $table = self::TABLE; protected $primaryKey = self::PK; + protected $returnType = CSEntity::class; protected $allowedFields = [ "type", "ip", @@ -23,7 +24,6 @@ class CSModel extends EquipmentModel public function __construct() { parent::__construct(); - $this->returnType = CSEntity::class; } public function getFormFieldRule(string $action, string $field): string { diff --git a/app/Models/Equipment/IpModel.php b/app/Models/Equipment/IpModel.php index 2088b5d..7df7e90 100644 --- a/app/Models/Equipment/IpModel.php +++ b/app/Models/Equipment/IpModel.php @@ -1,10 +1,10 @@ field가 array 입니다.\n" . var_export($field, true)); } switch ($field) { - case "model": + case $this->getPKField(): + $rule = "required|trim|min_length[4]|max_length[20]"; + $rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : ""; + break; + case "title": $rule = "required|trim|string"; $rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : ""; break; diff --git a/app/Models/Equipment/SwitchModel.php b/app/Models/Equipment/SwitchModel.php index ebf8099..332a3d9 100644 --- a/app/Models/Equipment/SwitchModel.php +++ b/app/Models/Equipment/SwitchModel.php @@ -7,13 +7,15 @@ use App\Entities\Equipment\SwitchEntity; class SwitchModel extends EquipmentModel { const TABLE = "switchinfo"; - const PK = "uid"; + const PK = "code"; const TITLE = "code"; protected $table = self::TABLE; protected $primaryKey = self::PK; + protected $useAutoIncrement = false; protected $returnType = SwitchEntity::class; protected $allowedFields = [ "code", + "serverinfo__code", "status", "updated_at" ]; @@ -28,7 +30,6 @@ class SwitchModel extends EquipmentModel } switch ($field) { case $this->getPKField(): - case "code": $rule = "required|trim|min_length[4]|max_length[20]"; $rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : ""; break; diff --git a/app/Models/UserModel.php b/app/Models/UserModel.php index 0e24f33..719c418 100644 --- a/app/Models/UserModel.php +++ b/app/Models/UserModel.php @@ -11,6 +11,7 @@ class UserModel extends CommonModel const TITLE = "name"; protected $table = self::TABLE; protected $primaryKey = self::PK; + protected $returnType = UserEntity::class; protected $allowedFields = [ "id", "passwd", @@ -24,7 +25,6 @@ class UserModel extends CommonModel public function __construct() { parent::__construct(); - $this->returnType = UserEntity::class; } public function getFormFieldRule(string $action, string $field): string { diff --git a/app/Services/Auth/GoogleService.php b/app/Services/Auth/GoogleService.php index 41937c3..c8d2d0a 100644 --- a/app/Services/Auth/GoogleService.php +++ b/app/Services/Auth/GoogleService.php @@ -13,7 +13,7 @@ class GoogleService extends AuthService public function __construct(mixed $mySocket) { $this->_mySocket = $mySocket; - parent::__construct(); + parent::__construct(new UserModel()); $this->addClassName('Google'); } public function getMySocket(): mixed @@ -23,15 +23,6 @@ class GoogleService extends AuthService } return $this->_mySOcket; } - final public function getModelClass(): UserModel - { - return new UserModel(); - } - final public function getEntityClass(): UserEntity - { - return new UserEntity(); - } - public function getFormFields(): array { return [ diff --git a/app/Services/Auth/LocalService.php b/app/Services/Auth/LocalService.php index b7cf91f..5f42ab2 100644 --- a/app/Services/Auth/LocalService.php +++ b/app/Services/Auth/LocalService.php @@ -7,20 +7,11 @@ use App\Models\UserModel; class LocalService extends AuthService { - public function __construct(UserModel $model) + public function __construct() { - parent::__construct($model); + parent::__construct(new UserModel()); $this->addClassName('Local'); } - final public function getModelClass(): UserModel - { - return new UserModel(); - } - final public function getEntityClass(): UserEntity - { - return new UserEntity(); - } - public function getFormFields(): array { return [ diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php index d0186dd..a2cd6df 100644 --- a/app/Services/CommonService.php +++ b/app/Services/CommonService.php @@ -79,7 +79,9 @@ abstract class CommonService } protected function findAllDatas_process(array $columns = ['*']): mixed { - return $this->getModel()->select(implode(',', $columns))->findAll(); + $entities = $this->getModel()->select(implode(',', $columns))->findAll(); + // dd($entities); + return $entities; } final public function getEntities(mixed $where = null, array $columns = ['*']): array { diff --git a/app/Services/Customer/AccountService.php b/app/Services/Customer/AccountService.php index bc0d76d..16ecdac 100644 --- a/app/Services/Customer/AccountService.php +++ b/app/Services/Customer/AccountService.php @@ -10,17 +10,9 @@ class AccountService extends CustomerService { public function __construct() { - parent::__construct(); + parent::__construct(new AccountModel()); $this->addClassName('Account'); } - public function getModelClass(): AccountModel - { - return new AccountModel(); - } - public function getEntityClass(): AccountEntity - { - return new AccountEntity(); - } public function getFormFields(): array { return [ diff --git a/app/Services/Customer/ClientService.php b/app/Services/Customer/ClientService.php index cf5d5fb..dca7131 100644 --- a/app/Services/Customer/ClientService.php +++ b/app/Services/Customer/ClientService.php @@ -9,17 +9,9 @@ class ClientService extends CustomerService { public function __construct() { - parent::__construct(); + parent::__construct(new ClientModel()); $this->addClassName('Client'); } - public function getModelClass(): ClientModel - { - return new ClientModel(); - } - public function getEntityClass(): ClientEntity - { - return new ClientEntity(); - } public function getFormFields(): array { return ['name', 'email', 'phone', 'role']; diff --git a/app/Services/Customer/CouponService.php b/app/Services/Customer/CouponService.php index 99b3ad7..fd766dd 100644 --- a/app/Services/Customer/CouponService.php +++ b/app/Services/Customer/CouponService.php @@ -10,17 +10,9 @@ class CouponService extends CustomerService { public function __construct() { - parent::__construct(); + parent::__construct(new CouponModel()); $this->addClassName('Coupon'); } - public function getModelClass(): CouponModel - { - return new CouponModel(); - } - public function getEntityClass(): CouponEntity - { - return new CouponEntity(); - } public function getFormFields(): array { return [ diff --git a/app/Services/Customer/PointService.php b/app/Services/Customer/PointService.php index 82dcb22..1cead23 100644 --- a/app/Services/Customer/PointService.php +++ b/app/Services/Customer/PointService.php @@ -10,17 +10,9 @@ class PointService extends CustomerService { public function __construct() { - parent::__construct(); + parent::__construct(new PointModel()); $this->addClassName('Point'); } - public function getModelClass(): PointModel - { - return new PointModel(); - } - public function getEntityClass(): PointEntity - { - return new PointEntity(); - } public function getFormFields(): array { return [ diff --git a/app/Services/Equipment/DefenceService.php b/app/Services/Equipment/CSService.php similarity index 68% rename from app/Services/Equipment/DefenceService.php rename to app/Services/Equipment/CSService.php index 1c5c76f..b52486c 100644 --- a/app/Services/Equipment/DefenceService.php +++ b/app/Services/Equipment/CSService.php @@ -1,25 +1,17 @@ addClassName('Defence'); } - public function getModelClass(): DefenceModel - { - return new DefenceModel(); - } - public function getEntityClass(): DefenceEntity - { - return new DefenceEntity(); - } public function getFormFields(): array { return [ diff --git a/app/Services/Equipment/DomainService.php b/app/Services/Equipment/DomainService.php index a15e6e5..06376e5 100644 --- a/app/Services/Equipment/DomainService.php +++ b/app/Services/Equipment/DomainService.php @@ -1,25 +1,17 @@ addClassName('Domain'); } - public function getModelClass(): DomainModel - { - return new DomainModel(); - } - public function getEntityClass(): DomainEntity - { - return new DomainEntity(); - } public function getFormFields(): array { return [ diff --git a/app/Services/Equipment/EquipmentService.php b/app/Services/Equipment/EquipmentService.php index f53764c..dc4ead3 100644 --- a/app/Services/Equipment/EquipmentService.php +++ b/app/Services/Equipment/EquipmentService.php @@ -4,13 +4,14 @@ namespace App\Services\Equipment; use App\Services\CommonService; use App\Services\Customer\ClientService; +use CodeIgniter\Model; abstract class EquipmentService extends CommonService { private ?ClientService $_clientService = null; - public function __construct() + protected function __construct(Model $model) { - parent::__construct(); + parent::__construct($model); $this->addClassName('Equipment'); } diff --git a/app/Services/Equipment/IpService.php b/app/Services/Equipment/IpService.php index 1f81634..5eed7d2 100644 --- a/app/Services/Equipment/IpService.php +++ b/app/Services/Equipment/IpService.php @@ -1,28 +1,21 @@ addClassName('Ip'); } - public function getModelClass(): IpModel - { - return new IpModel(); - } - public function getEntityClass(): IpEntity - { - return new IpEntity(); - } public function getFormFields(): array { return [ diff --git a/app/Services/Equipment/LineService.php b/app/Services/Equipment/LineService.php index 15486bc..65781d6 100644 --- a/app/Services/Equipment/LineService.php +++ b/app/Services/Equipment/LineService.php @@ -1,25 +1,16 @@ addClassName('Line'); } - public function getModelClass(): LineModel - { - return new LineModel(); - } - public function getEntityClass(): LineEntity - { - return new LineEntity(); - } public function getFormFields(): array { return [ diff --git a/app/Services/Equipment/PartService.php b/app/Services/Equipment/PartService.php index 8e40afa..502d4a8 100644 --- a/app/Services/Equipment/PartService.php +++ b/app/Services/Equipment/PartService.php @@ -1,14 +1,15 @@ addClassName('Part'); } //FieldForm관련용 diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 8549a9a..4740fd4 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -10,23 +10,18 @@ class ServerService extends EquipmentService { public function __construct() { - parent::__construct(); + parent::__construct(new ServerModel()); $this->addClassName('Server'); } - public function getModelClass(): ServerModel - { - return new ServerModel(); - } - public function getEntityClass(): ServerEntity - { - return new ServerEntity(); - } public function getFormFields(): array { return [ - "model", + "code", + "title", + "price", + "amount", + "manufactur_at", "status", - "description", ]; } public function getFilterFields(): array @@ -39,13 +34,13 @@ class ServerService extends EquipmentService } public function getIndexFields(): array { - return ['model', 'status']; + return ['title', 'price', 'amount', 'manufactur_at', 'status']; } //List 검색용 //OrderBy 처리 public function setOrderBy(mixed $field = null, mixed $value = null): void { - $this->getModel()->orderBy('model', 'ASC'); + $this->getModel()->orderBy('title', 'ASC'); parent::setOrderBy($field, $value); } } diff --git a/app/Services/Equipment/SwitchService.php b/app/Services/Equipment/SwitchService.php index bfd1534..56c1b31 100644 --- a/app/Services/Equipment/SwitchService.php +++ b/app/Services/Equipment/SwitchService.php @@ -10,17 +10,9 @@ class SwitchService extends EquipmentService { public function __construct() { - parent::__construct(); + parent::__construct(new SwitchModel()); $this->addClassName('Switch'); } - public function getModelClass(): SwitchModel - { - return new SwitchModel(); - } - public function getEntityClass(): SwitchEntity - { - return new SwitchEntity(); - } public function getFormFields(): array { return [ diff --git a/app/Services/MyLogService.php b/app/Services/MyLogService.php index 6300eed..fb57796 100644 --- a/app/Services/MyLogService.php +++ b/app/Services/MyLogService.php @@ -13,18 +13,9 @@ class MyLogService extends CommonService private $_userService = null; public function __construct() { - parent::__construct(); + parent::__construct(new MyLogModel()); $this->addClassName('MyLog'); } - public function getModelClass(): MyLogModel - { - return new MyLogModel(); - } - public function getEntityClass(): MyLogEntity - { - return new MyLogEntity(); - } - public function getFormFields(): array { return [ diff --git a/app/Services/Customer/ServicePaymentService.php b/app/Services/Payment/Month.php similarity index 100% rename from app/Services/Customer/ServicePaymentService.php rename to app/Services/Payment/Month.php diff --git a/app/Services/Payment/Onetime.php b/app/Services/Payment/Onetime.php new file mode 100644 index 0000000..cb7070a --- /dev/null +++ b/app/Services/Payment/Onetime.php @@ -0,0 +1,122 @@ +addClassName('ServicePayment'); + } + public function getModelClass(): ServicePaymentModel + { + return new ServicePaymentModel(); + } + public function getEntityClass(): ServicePaymentEntity + { + return new ServicePaymentEntity(); + } + public function getFormFields(): array + { + return [ + "serviceinfo_uid", + "ownerinfo_uid", + "item_type", + "item_uid", + "billing_cycle", + "amount", + "billing_at", + "issue_at", + "status", + ]; + } + public function getFilterFields(): array + { + return ["serviceinfo_uid", "ownerinfo_uid", 'user_uid', 'item_type', 'billing_cycle', 'status']; + } + public function getBatchJobFields(): array + { + return ['status']; + } + public function getIndexFields(): array + { + return ["ownerinfo_uid", 'serviceinfo_uid', 'item_type', 'item_uid', 'billing_cycle', 'amount', 'billing_at', 'issue_at', 'countdown', 'status', 'user_uid']; + } + public function getBatchJobButtons(): array + { + return [ + 'invoice' => '청구서 발행', + ]; + } + //기본 기능부분 + //FieldForm관련용 + public function getFormFieldOption(string $field, array $options = []): array + { + switch ($field) { + case 'item_uid': + $options = []; + break; + default: + $options = parent::getFormFieldOption($field, $options); + break; + } + return $options; + } + //미납서비스 정보 + final public function getUnPaidCountByService(): array + { + $sql = sprintf("SELECT serviceinfo_uid,COUNT(*) as CNT + FROM serviceinfo_payment + WHERE billing_at < NOW() AND amount > 0 AND status = '%s' + GROUP BY serviceinfo_uid", DEFAULTS['STATUS']); + $unpaids = []; + foreach ($this->getModel()->query($sql)->getResult() as $row) { + $unpaids[$row->serviceinfo_uid] = $row->CNT; + } + return $unpaids; + } + //결체처리정보 등록 : ServiceItemService에서 사용 + public function createByServiceItemService(array $formDatas, ServiceItemEntity $serviceItemEntity): ServicePaymentEntity + { + $serviceEntity = $this->getServiceService()->getEntity($serviceItemEntity->getServiceUid()); + if (!$serviceEntity) { + throw new \Exception("{$serviceItemEntity->getServiceUid()}에 대한 서비스정보를 찾을수 없습니다."); + } + $formDatas['serviceinfo_uid'] = $serviceItemEntity->getServiceUid(); + $formDatas['ownerinfo_uid'] = $serviceEntity->getOwnerUid(); + $formDatas['item_type'] = $serviceItemEntity->getItemType(); + $formDatas['item_uid'] = $serviceItemEntity->getItemUid(); + $formDatas['billing_cycle'] = $serviceItemEntity->getBillingCycle(); + $formDatas['amount'] = $serviceItemEntity->getAmount(); + $formDatas['billing_at'] = $serviceEntity->getBillingAt(); + $formDatas['issue_at'] = date('Y-m-d'); + return $this->create($formDatas); + } + + //Service정보 와 관리자가 기존 정보과 같고, 결제가 아직 완료되지 않은 결제정보의 관리자 변경 + public function modifyOwnerByService(ServiceEntity $serviceEntity, int $ownerinfo_uid) + { + foreach ( + $this->getEntities([ + 'serviceinfo_uid' => $serviceEntity->getPK(), + 'ownerinfo_uid' => $serviceEntity->getOwnerUID(), + 'status' => DEFAULTS['STATUS'] + ]) as $entity + ) { + $this->modify($entity, ['ownerinfo_uid' => $ownerinfo_uid]); + } + } + //List 검색용 + //OrderBy 처리 + public function setOrderBy(mixed $field = null, mixed $value = null): void + { + $this->getModel()->orderBy('billing_at ASC'); + parent::setOrderBy($field, $value); + } +} diff --git a/app/Services/UserSNSService.php b/app/Services/UserSNSService.php index af27ab3..f2d7be0 100644 --- a/app/Services/UserSNSService.php +++ b/app/Services/UserSNSService.php @@ -10,17 +10,9 @@ class UserSNSService extends CommonService { public function __construct() { - parent::__construct();; + parent::__construct(new UserSNSModel()); $this->addClassName('UserSNS'); } - public function getModelClass(): UserSNSModel - { - return new UserSNSModel(); - } - public function getEntityClass(): UserSNSEntity - { - return new UserSNSEntity(); - } public function getFormFields(): array { return [ diff --git a/app/Views/layouts/admin/left_menu/equipment.php b/app/Views/layouts/admin/left_menu/equipment.php index 4822cf3..3b8ce9e 100644 --- a/app/Views/layouts/admin/left_menu/equipment.php +++ b/app/Views/layouts/admin/left_menu/equipment.php @@ -8,9 +8,6 @@
- @@ -18,7 +15,10 @@ = ICONS['SERVICE_ITEM_IP'] ?>IP정보 + \ No newline at end of file