dbmsv2 init...1

This commit is contained in:
choi.jh 2025-08-20 11:42:32 +09:00
parent e5d3f0bb10
commit 0af2cef113
8 changed files with 25 additions and 18 deletions

View File

@ -4,7 +4,6 @@ namespace App\Controllers\Admin\Customer;
use App\Helpers\Customer\ClientHelper;
use App\Services\Customer\ClientService;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;

View File

@ -4,8 +4,8 @@
"settings": {
"width": 3000,
"height": 3000,
"scrollTop": -991.0994,
"scrollLeft": -952.1533,
"scrollTop": -962.0994,
"scrollLeft": -672.1533,
"zoomLevel": 0.79,
"show": 511,
"database": 4,

View File

@ -557,4 +557,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2025-08-20 11:06:56
-- Dump completed on 2025-08-20 11:20:06

View File

@ -2,7 +2,9 @@
return [
'title' => "고객정보",
'label' => [
'user_uid' => "관리자UID",
'code' => "고객코드",
'site' => "사이틍구분",
'email' => "메일",
'phone' => "연락처",
'role' => "권한",
@ -15,6 +17,11 @@ return [
'created_at' => "등록일",
'deleted_at' => "삭제일",
],
"SITE" => [
"prime" => "PRIME",
"itsolution" => "ITSOLUTION",
"gdidc" => "GDIDC",
],
"ROLE" => [
"user" => "일반회원",
"vip" => "VIP회원",

View File

@ -14,6 +14,7 @@ class ClientModel extends CustomerModel
protected $primaryKey = self::PK;
protected $returnType = ClientEntity::class;
protected $allowedFields = [
"user_uid",
"site",
"code",
"name",
@ -36,6 +37,9 @@ class ClientModel extends CustomerModel
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "user_uid":
$rule = "required|numeric";
break;
case "code":
$rule = "required|trim|alpha_numeric|min_length[4]|max_length[20]";
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";

View File

@ -8,7 +8,7 @@ use tidy;
class ServiceModel extends CustomerModel
{
const TABLE = "serviceinfo";
const PK = "code";
const PK = "uid";
const TITLE = "code";
protected $table = self::TABLE;
// protected $useAutoIncrement = false;
@ -36,15 +36,15 @@ class ServiceModel extends CustomerModel
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case $this->getPKField():
case "code":
$rule = "required|trim|alpha_numeric|min_length[4]|max_length[20]";
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
break;
case "user_uid":
case "clientinfo_uid":
case "amount":
$rule = "required|numeric";
break;
case "clientinfo_uid":
case "type":
case "location":
case "status":

View File

@ -14,19 +14,19 @@ class ClientService extends CustomerService
}
public function getFormFields(): array
{
return ['name', 'email', 'phone', 'role'];
return ['site', 'name', 'email', 'phone', 'role'];
}
public function getFilterFields(): array
{
return ['role', 'status'];
return ['site', 'role', 'status'];
}
public function getBatchJobFields(): array
{
return ['status'];
return ['site', 'role', 'status'];
}
public function getIndexFields(): array
{
return ['name', 'email', 'phone', 'role', 'account_balance', 'coupon_balance', 'point_balance', 'status', 'created_at', 'updated_at'];
return ['site', 'name', 'email', 'phone', 'role', 'account_balance', 'coupon_balance', 'point_balance', 'status', 'created_at', 'updated_at'];
}
//기본 기능부분
@ -127,7 +127,7 @@ class ClientService extends CustomerService
//OrderBy 처리
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy("name", 'ASC');
$this->getModel()->orderBy("site ASC,name ASC");
parent::setOrderBy($field, $value);
}
}

View File

@ -16,13 +16,10 @@ class ServerService extends EquipmentService
public function getFormFields(): array
{
return [
"clientinfo_uid",
"serviceinfo_uid",
"code",
"type",
"title",
"price",
"total_price",
"manufactur_at",
"format_at",
"status",
@ -30,11 +27,11 @@ class ServerService extends EquipmentService
}
public function getFilterFields(): array
{
return ['status'];
return ['clientinfo_uid', 'serviceinfo_uid', 'status'];
}
public function getBatchJobFields(): array
{
return ['type', 'status'];
return ['clientinfo_uid', 'type', 'status'];
}
public function getIndexFields(): array
{
@ -46,7 +43,7 @@ class ServerService extends EquipmentService
//OrderBy 처리
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('title', 'ASC');
$this->getModel()->orderBy("code ASC,title ASC");
parent::setOrderBy($field, $value);
}
}