From c717aab6e9d995acfae49aad43ea90a83430ca1b 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, 5 Aug 2023 21:30:46 +0900 Subject: [PATCH] shoppingmallv2 init... --- app/Controllers/BaseController.php | 2 +- app/Controllers/Front/ProductController.php | 6 ++-- app/Helpers/Product_helper.php | 4 +++ app/Views/front/board/index.php | 2 +- app/Views/front/order/index.php | 2 +- app/Views/front/product/index.php | 6 +++- app/Views/front/product/index_b.php | 38 +++++++++++++++++++++ app/Views/front/user/index.php | 2 +- 8 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 app/Views/front/product/index_b.php diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index f359f1b..a6849a5 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -575,7 +575,7 @@ abstract class BaseController extends Controller //setting return_url to session flashdata helper(['form']); $this->_session->setFlashdata(SESSION_NAMES['RETURN_URL'], current_url() . '?' . $this->request->getUri()->getQuery() ?: ""); - return view($this->_viewPath . '/index', ['viewDatas' => $this->_viewDatas]); + return view($this->_viewPath . '/index' . $this->request->getVar('v') ?: '', ['viewDatas' => $this->_viewDatas]); } catch (\Exception $e) { return alert_CommonHelper($e->getMessage(), "back"); // return redirect()->back()->with('return_message', $e->getMessage()); diff --git a/app/Controllers/Front/ProductController.php b/app/Controllers/Front/ProductController.php index 47bb028..0a084b4 100644 --- a/app/Controllers/Front/ProductController.php +++ b/app/Controllers/Front/ProductController.php @@ -17,11 +17,11 @@ class ProductController extends FrontController } public function getFields(string $action = ""): array { - $fields = ["category_uid", 'name', "photo", "cost", "price", "sale", "stock", "view_cnt", "status", "content",]; + $fields = ['name', "photo", "cost", "price", "sale", "stock", "view_cnt", "status", "content",]; switch ($action) { case "index": case "excel": - return ["category_uid", "user_uid", 'name', "photo", "cost", "price", "sale", "stock", "view_cnt", "status", "created_at"]; + return ["user_uid", 'name', "photo", "cost", "price", "sale", "stock", "view_cnt", "status", "created_at"]; break; case "view": return [...$fields, "created_at"]; @@ -33,7 +33,7 @@ class ProductController extends FrontController } public function getFieldFilters(): array { - return ["category_uid", "user_uid", "status"]; + return ["user_uid", "status"]; } public function getFieldBatchFilters(): array { diff --git a/app/Helpers/Product_helper.php b/app/Helpers/Product_helper.php index b256af0..0a61993 100644 --- a/app/Helpers/Product_helper.php +++ b/app/Helpers/Product_helper.php @@ -82,6 +82,10 @@ function getFieldView_ProductHelper($field, $entity, array $viewDatas) case 'photo': return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . "/download/{$field}/{$entity->getPrimaryKey()}", ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], ["target" => "_self"]); break; + case 'cost': + case 'price': + case 'sale': + case 'stock': case 'view_cnt': return number_format(!$value ? 0 : $value); break; diff --git a/app/Views/front/board/index.php b/app/Views/front/board/index.php index 1996cb5..13b8631 100644 --- a/app/Views/front/board/index.php +++ b/app/Views/front/board/index.php @@ -29,7 +29,7 @@ - + diff --git a/app/Views/front/order/index.php b/app/Views/front/order/index.php index 7d8f4fe..de6ae04 100644 --- a/app/Views/front/order/index.php +++ b/app/Views/front/order/index.php @@ -23,7 +23,7 @@ - + getStatus() == DEFAULTS['STATUS'] ? anchor('ecommerce/cancelCart/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) : "" ?> diff --git a/app/Views/front/product/index.php b/app/Views/front/product/index.php index 140a104..c723a4f 100644 --- a/app/Views/front/product/index.php +++ b/app/Views/front/product/index.php @@ -10,6 +10,10 @@ +
+ getPrimaryKey(), 'List', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?> + getPrimaryKey() . '&v=_b', 'Block', ["class" => "btn btn-sm btn-info btn-circle", "target" => "_self"]) ?> +
@@ -23,7 +27,7 @@ - + diff --git a/app/Views/front/product/index_b.php b/app/Views/front/product/index_b.php new file mode 100644 index 0000000..00a035a --- /dev/null +++ b/app/Views/front/product/index_b.php @@ -0,0 +1,38 @@ +extend('layouts/front') ?> +section('content') ?> +
+
getHead()) ?>
+
+ "get")) ?> + + +
+ +
+
+ getPrimaryKey(), 'List', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?> + getPrimaryKey() . '&v=_b', 'Block', ["class" => "btn btn-sm btn-info btn-circle", "target" => "_self"]) ?> +
+ + +
+ + + + + + +
-
+ + + +
+ +
+ +
getTail()) ?>
+ +endSection() ?> \ No newline at end of file diff --git a/app/Views/front/user/index.php b/app/Views/front/user/index.php index d220f60..cf8a735 100644 --- a/app/Views/front/user/index.php +++ b/app/Views/front/user/index.php @@ -25,7 +25,7 @@ - +