From 5d4391a0f7dfa2983e571209757e312001aa8582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0git=20config=20git=20config=20-?= =?UTF-8?q?-helpgit=20config=20--global=20user=2Ename=20=EC=B5=9C=EC=A4=80?= =?UTF-8?q?=ED=9D=A0?= Date: Sat, 12 Aug 2023 10:12:20 +0900 Subject: [PATCH] shoppingmallv2 init... --- app/Controllers/Ecommerce/CartController.php | 2 +- app/Helpers/Board_helper.php | 8 ++--- app/Helpers/Category_helper.php | 9 +----- app/Helpers/Deposit_helper.php | 1 - app/Helpers/Order_helper.php | 29 ++--------------- app/Helpers/Payment_helper.php | 33 +------------------- app/Helpers/Product_helper.php | 8 ++--- app/Helpers/Sitepage_helper.php | 23 ++++++++++---- app/Helpers/UserSNS_helper.php | 30 +++++++----------- app/Helpers/User_helper.php | 18 +---------- app/Language/ko/Card.php | 2 +- app/Language/ko/Deposit.php | 2 +- app/Language/ko/Order.php | 3 +- app/Views/front/order/index.php | 2 ++ public/css/admin/content.css | 8 ++--- public/css/front/content.css | 7 ++--- 16 files changed, 51 insertions(+), 134 deletions(-) diff --git a/app/Controllers/Ecommerce/CartController.php b/app/Controllers/Ecommerce/CartController.php index b23562e..06af23b 100644 --- a/app/Controllers/Ecommerce/CartController.php +++ b/app/Controllers/Ecommerce/CartController.php @@ -30,7 +30,7 @@ class CartController extends EcommerceController case "product_uid": case "quantity": case "price": - $rules = $this->getOrderModel()->getFieldRules($field, $rules, $action); + $rules = $this->getOrderModel()->getFieldRule($field, $rules, $action); break; default: $rules = parent::getFieldRule($field, $rules, $action); diff --git a/app/Helpers/Board_helper.php b/app/Helpers/Board_helper.php index 8569a27..a2b7401 100644 --- a/app/Helpers/Board_helper.php +++ b/app/Helpers/Board_helper.php @@ -113,10 +113,6 @@ function getFieldIndex_Column_BoardHelper($field, array $viewDatas) $viewDatas['uri']->addQuery('order_value', $value); $columnData = anchor($viewDatas['uri'], $label); switch ($field) { - case 'title': - case 'name': - return sprintf("%s", $columnData); - break; default: return sprintf("%s", $columnData); break; @@ -143,7 +139,7 @@ function getFieldIndex_Row_BoardHelper($field, $entity, array $viewDatas): strin $value, ["target" => "_self"] ); - return sprintf("%s%s %s", $depth, $reply, $view); + return sprintf("%s%s %s", $depth, $reply, $view); break; default: return sprintf("%s", getFieldView_BoardHelper($field, $entity, $viewDatas)); @@ -172,7 +168,7 @@ function getFieldIndex_Row_BoardHelper_Admin($field, $entity, array $viewDatas): $value, ["target" => "_self"] ); - return sprintf("%s%s %s", $depth, $reply, $view); + return sprintf("%s%s %s", $depth, $reply, $view); break; default: if (in_array($field, $viewDatas['fieldFilters'])) { diff --git a/app/Helpers/Category_helper.php b/app/Helpers/Category_helper.php index 40f3ad3..19f8424 100644 --- a/app/Helpers/Category_helper.php +++ b/app/Helpers/Category_helper.php @@ -113,10 +113,6 @@ function getFieldIndex_Column_CategoryHelper($field, array $viewDatas) $viewDatas['uri']->addQuery('order_value', $value); $columnData = anchor($viewDatas['uri'], $label); switch ($field) { - case 'title': - case 'name': - return sprintf("%s", $columnData); - break; default: return sprintf("%s", $columnData); break; @@ -153,10 +149,7 @@ function getFieldIndex_Row_CategoryHelper_Admin($field, $entity, array $viewData $value, ["target" => "_self"] ); - return sprintf("%s%s %s", $depth, $reply, $view); - break; - case 'linkurl': - return sprintf("%s
%s", $entity->getFileImage('middle', 'photo'), $value); + return sprintf("%s%s %s", $depth, $reply, $view); break; default: if (in_array($field, $viewDatas['fieldFilters'])) { diff --git a/app/Helpers/Deposit_helper.php b/app/Helpers/Deposit_helper.php index fd35190..95c6892 100644 --- a/app/Helpers/Deposit_helper.php +++ b/app/Helpers/Deposit_helper.php @@ -65,7 +65,6 @@ function getFieldIndex_Column_DepositHelper($field, array $viewDatas) //Front용 function getFieldIndex_Row_DepositHelper($field, $entity, array $viewDatas): string { - $value = $entity->$field ?: DEFAULTS['EMPTY']; switch ($field) { default: return sprintf("%s", getFieldView_DepositHelper($field, $entity, $viewDatas)); diff --git a/app/Helpers/Order_helper.php b/app/Helpers/Order_helper.php index 7e77894..a4bda84 100644 --- a/app/Helpers/Order_helper.php +++ b/app/Helpers/Order_helper.php @@ -107,10 +107,6 @@ function getFieldIndex_Column_OrderHelper($field, array $viewDatas) $viewDatas['uri']->addQuery('order_value', $value); $columnData = anchor($viewDatas['uri'], $label); switch ($field) { - case 'title': - case 'name': - return sprintf("%s", $columnData); - break; default: return sprintf("%s", $columnData); break; @@ -125,9 +121,7 @@ function getFieldIndex_Row_OrderHelper($field, $entity, array $viewDatas): strin case 'title': case 'name': return sprintf( - "%s : %s
%s", - lang("{$viewDatas['className']}.label.uid"), - $entity->getOrderHint(), + "%s", anchor( current_url() . '/view/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(), $value, @@ -138,21 +132,16 @@ function getFieldIndex_Row_OrderHelper($field, $entity, array $viewDatas): strin case 'status': if ($value == DEFAULTS['STATUS']) { return sprintf( - "
%s
%s
%s
", + "
%s
%s
", anchor( URLS['paymentCard'] . '?order_uid=' . $entity->getPrimaryKey(), - "카드결제", + "카 드 결 제", ["class" => "btn btn-sm btn-primary btn-circle", "style" => "color:white", "target" => "_self"] ), anchor( URLS['paymentDeposit'] . '?order_uid=' . $entity->getPrimaryKey(), "무통장입금", ["class" => "btn btn-sm btn-info btn-circle", "style" => "color:white", "target" => "_self"] - ), - anchor( - current_url() . '/delete/' . $entity->getPrimaryKey(), - ICONS['DELETE'] . '주문취소', - ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"] ) ); } else { @@ -167,19 +156,7 @@ function getFieldIndex_Row_OrderHelper($field, $entity, array $viewDatas): strin //Admin용 function getFieldIndex_Row_OrderHelper_Admin($field, $entity, array $viewDatas): string { - $value = $entity->$field ?: DEFAULTS['EMPTY']; switch ($field) { - case 'title': - case 'name': - return sprintf("%s", anchor( - current_url() . '/view/' . $entity->getPrimaryKey(), - $value, - ["target" => "_self"] - )); - break; - case 'status': - return sprintf("%s", getFieldView_OrderHelper($field, $entity, $viewDatas)); - break; default: if (in_array($field, $viewDatas['fieldFilters'])) { $attributes["onChange"] = sprintf( diff --git a/app/Helpers/Payment_helper.php b/app/Helpers/Payment_helper.php index d6f8236..f435adc 100644 --- a/app/Helpers/Payment_helper.php +++ b/app/Helpers/Payment_helper.php @@ -143,10 +143,6 @@ function getFieldIndex_Column_PaymentHelper($field, array $viewDatas) $viewDatas['uri']->addQuery('order_value', $value); $columnData = anchor($viewDatas['uri'], $label); switch ($field) { - case 'title': - case 'name': - return sprintf("%s", $columnData); - break; default: return sprintf("%s", $columnData); break; @@ -161,7 +157,7 @@ function getFieldIndex_Row_PaymentHelper($field, $entity, array $viewDatas): str case 'title': case 'name': return sprintf( - "%s", + "%s", anchor( current_url() . '/view/' . $entity->getPrimaryKey(), $value, @@ -169,18 +165,6 @@ function getFieldIndex_Row_PaymentHelper($field, $entity, array $viewDatas): str ) ); break; - break; - case 'status': - if ($value == DEFAULTS['STATUS']) { - return sprintf("%s", anchor( - '/front/payment/card/' . $entity->getPrimaryKey(), - $viewDatas['fieldFormOptions'][$field][$value], - ["class" => "btn btn-sm btn-primary btn-circle", "style" => "color:white", "target" => "_self"] - )); - } else { - return sprintf("%s", getFieldView_PaymentHelper($field, $entity, $viewDatas)); - } - break; default: return sprintf("%s", getFieldView_PaymentHelper($field, $entity, $viewDatas)); break; @@ -189,22 +173,7 @@ function getFieldIndex_Row_PaymentHelper($field, $entity, array $viewDatas): str //Admin용 function getFieldIndex_Row_PaymentHelper_Admin($field, $entity, array $viewDatas): string { - $value = $entity->$field ?: DEFAULTS['EMPTY']; switch ($field) { - case 'title': - case 'name': - return sprintf( - "%s", - anchor( - current_url() . '/view/' . $entity->getPrimaryKey(), - $value, - ["target" => "_self"] - ) - ); - break; - case 'status': - return sprintf("%s", getFieldView_PaymentHelper($field, $entity, $viewDatas)); - break; default: if (in_array($field, $viewDatas['fieldFilters'])) { $attributes["onChange"] = sprintf( diff --git a/app/Helpers/Product_helper.php b/app/Helpers/Product_helper.php index 0fffdda..d3059c8 100644 --- a/app/Helpers/Product_helper.php +++ b/app/Helpers/Product_helper.php @@ -125,10 +125,6 @@ function getFieldIndex_Column_ProductHelper($field, array $viewDatas) $viewDatas['uri']->addQuery('order_value', $value); $columnData = anchor($viewDatas['uri'], $label); switch ($field) { - case 'title': - case 'name': - return sprintf("%s", $columnData); - break; default: return sprintf("%s", $columnData); break; @@ -150,7 +146,7 @@ function getFieldIndex_Row_ProductHelper($field, $entity, array $viewDatas): str ); break; default: - return getFieldView_ProductHelper($field, $entity, $viewDatas); + return sprintf("%s", getFieldView_SitepageHelper($field, $entity, $viewDatas)); break; } } // @@ -178,7 +174,7 @@ function getFieldIndex_Row_ProductHelper_Admin($field, $entity, array $viewDatas ); return sprintf("%s", getFieldForm_ProductHelper($field, $entity->$field, $viewDatas, $attributes)); } - return sprintf("%s", getFieldIndex_Row_ProductHelper($field, $entity, $viewDatas)); + return getFieldIndex_Row_ProductHelper($field, $entity, $viewDatas); break; } } // \ No newline at end of file diff --git a/app/Helpers/Sitepage_helper.php b/app/Helpers/Sitepage_helper.php index 2336ad0..b8ace0e 100644 --- a/app/Helpers/Sitepage_helper.php +++ b/app/Helpers/Sitepage_helper.php @@ -113,10 +113,6 @@ function getFieldIndex_Column_SitepageHelper($field, array $viewDatas) $viewDatas['uri']->addQuery('order_value', $value); $columnData = anchor($viewDatas['uri'], $label); switch ($field) { - case 'title': - case 'name': - return sprintf("%s", $columnData); - break; default: return sprintf("%s", $columnData); break; @@ -126,11 +122,26 @@ function getFieldIndex_Column_SitepageHelper($field, array $viewDatas) //Front용 function getFieldIndex_Row_SitepageHelper($field, $entity, array $viewDatas): string { + $value = $entity->$field ?: DEFAULTS['EMPTY']; switch ($field) { - default: + case 'title': + case 'name': + return sprintf( + "%s", + anchor( + current_url() . '/view/' . $entity->getPrimaryKey(), + $value, + ["target" => "_self"] + ) + ); + break; + case 'content': //front쪽은 table을 사용하지 않음 주의 return getFieldView_SitepageHelper($field, $entity, $viewDatas); break; + default: + return sprintf("%s", getFieldView_SitepageHelper($field, $entity, $viewDatas)); + break; } } // @@ -149,7 +160,7 @@ function getFieldIndex_Row_SitepageHelper_Admin($field, $entity, array $viewData ); return sprintf("%s", getFieldForm_SitepageHelper($field, $entity->$field, $viewDatas, $attributes)); } - return sprintf("%s", getFieldIndex_Row_SitepageHelper($field, $entity, $viewDatas)); + return getFieldIndex_Row_SitepageHelper($field, $entity, $viewDatas); break; } } // \ No newline at end of file diff --git a/app/Helpers/UserSNS_helper.php b/app/Helpers/UserSNS_helper.php index 2b4ab44..f3e64d0 100644 --- a/app/Helpers/UserSNS_helper.php +++ b/app/Helpers/UserSNS_helper.php @@ -101,10 +101,6 @@ function getFieldIndex_Column_UserSNSHelper($field, array $viewDatas) $viewDatas['uri']->addQuery('order_value', $value); $columnData = anchor($viewDatas['uri'], $label); switch ($field) { - case 'title': - case 'name': - return sprintf("%s", $columnData); - break; default: return sprintf("%s", $columnData); break; @@ -114,7 +110,19 @@ function getFieldIndex_Column_UserSNSHelper($field, array $viewDatas) //Front용 function getFieldIndex_Row_UserSNSHelper($field, $entity, array $viewDatas): string { + $value = $entity->$field ?: DEFAULTS['EMPTY']; switch ($field) { + case 'title': + case 'name': + return sprintf( + "%s", + anchor( + current_url() . '/view/' . $entity->getPrimaryKey(), + $value, + ["target" => "_self"] + ) + ); + break; default: return sprintf("%s", getFieldView_UserSNSHelper($field, $entity, $viewDatas)); break; @@ -123,21 +131,7 @@ function getFieldIndex_Row_UserSNSHelper($field, $entity, array $viewDatas): str //Admin용 function getFieldIndex_Row_UserSNSHelper_Admin($field, $entity, array $viewDatas): string { - $value = $entity->$field ?: DEFAULTS['EMPTY']; switch ($field) { - case 'title': - case 'name': - return sprintf( - "%s : %s", - lang("{$viewDatas['className']}.label.uid"), - $entity->getPrimaryKey(), - anchor( - current_url() . '/view/' . $entity->getPrimaryKey(), - $value, - ["target" => "_self"] - ) - ); - break; default: if (in_array($field, $viewDatas['fieldFilters'])) { $attributes["onChange"] = sprintf( diff --git a/app/Helpers/User_helper.php b/app/Helpers/User_helper.php index 64982e7..4637a91 100644 --- a/app/Helpers/User_helper.php +++ b/app/Helpers/User_helper.php @@ -117,10 +117,6 @@ function getFieldIndex_Column_UserHelper($field, array $viewDatas) $viewDatas['uri']->addQuery('order_value', $value); $columnData = anchor($viewDatas['uri'], $label); switch ($field) { - case 'title': - case 'name': - return sprintf("%s", $columnData); - break; default: return sprintf("%s", $columnData); break; @@ -135,7 +131,7 @@ function getFieldIndex_Row_UserHelper($field, $entity, array $viewDatas): string case 'title': case 'name': return sprintf( - "%s", + "%s", anchor( current_url() . '/view/' . $entity->getPrimaryKey(), $value, @@ -154,19 +150,7 @@ function getFieldIndex_Row_UserHelper_Admin($field, $entity, array $viewDatas): { $value = $entity->$field ?: DEFAULTS['EMPTY']; switch ($field) { - case 'title': - case 'name': - return sprintf( - "%s", - anchor( - current_url() . '/view/' . $entity->getPrimaryKey(), - $value, - ["target" => "_self"] - ) - ); - break; case 'role': - $value = $entity->$field ?: DEFAULTS['EMPTY']; // $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]]; // return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, [...$attributes, 'class' => "select-field"]); // return form_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]); diff --git a/app/Language/ko/Card.php b/app/Language/ko/Card.php index 494b0ac..9e11733 100644 --- a/app/Language/ko/Card.php +++ b/app/Language/ko/Card.php @@ -7,7 +7,7 @@ return [ 'card_number' => '카드번호', 'card_expiration' => '유효기간', 'email' => '이메일', - 'mobile' => '휴대폰(인증용)', + 'mobile' => '인증휴대폰', ], "CARD_QUOTA" => [ "00" => "일시불", diff --git a/app/Language/ko/Deposit.php b/app/Language/ko/Deposit.php index aecbf23..5a82e37 100644 --- a/app/Language/ko/Deposit.php +++ b/app/Language/ko/Deposit.php @@ -4,6 +4,6 @@ return [ 'label' => [ 'order_uid' => '주문번호', 'email' => '이메일', - 'mobile' => '휴대폰(인증용)', + 'mobile' => '인증휴대폰', ], ]; diff --git a/app/Language/ko/Order.php b/app/Language/ko/Order.php index 487c06f..dcb64e1 100644 --- a/app/Language/ko/Order.php +++ b/app/Language/ko/Order.php @@ -8,7 +8,7 @@ return [ 'user_uid' => "사용자정보", 'name' => "상품명", 'cost' => "판매금액", - 'sale' => "협상할인가", + 'sale' => "할인", 'quantity' => "수량", 'price' => "결제금액", 'status' => "상태", @@ -18,6 +18,7 @@ return [ "STATUS" => [ "use" => "장바구니", "unuse" => "주문취소", + "confirm" => "주문완료", "paid" => "결제완료" ] ]; diff --git a/app/Views/front/order/index.php b/app/Views/front/order/index.php index 71de180..abbf543 100644 --- a/app/Views/front/order/index.php +++ b/app/Views/front/order/index.php @@ -11,6 +11,7 @@ 번호 + 취소 @@ -23,6 +24,7 @@ + getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?> diff --git a/public/css/admin/content.css b/public/css/admin/content.css index a7961a8..f89f2a0 100644 --- a/public/css/admin/content.css +++ b/public/css/admin/content.css @@ -64,6 +64,8 @@ div#content table.product tr:first-child { border-top:2px solid black; border-bottom:1px solid silver; } +/* 상품 리스트 전용 */ + div#content table thead th{ white-space: nowrap; text-align:center; @@ -80,15 +82,11 @@ div#content table tbody td { /* border:1px solid silver; */ text-align:center; } -div#content table tbody td.hierarchy { - /* border:1px solid silver; */ - text-align:left; -} + div#content div.bottom { padding-top:15px; text-align:center; } - div#content div.bottom ul.pagination { margin-top:20px; } diff --git a/public/css/front/content.css b/public/css/front/content.css index 3b1fc3d..377d3e1 100644 --- a/public/css/front/content.css +++ b/public/css/front/content.css @@ -66,6 +66,7 @@ div#content table.product tr:first-child { border-bottom:1px solid silver; } /* 상품 리스트 전용 */ + div#content table thead th{ white-space: nowrap; text-align:center; @@ -82,15 +83,11 @@ div#content table tbody td { /* border:1px solid silver; */ text-align:center; } -div#content table tbody td.hierarchy { - /* border:1px solid silver; */ - text-align:left; -} + div#content div.bottom { padding-top:15px; text-align:center; } - div#content div.bottom ul.pagination { margin-top:20px; }