diff --git a/app/Controllers/Front/ProductController.php b/app/Controllers/Front/ProductController.php index 0a084b4..1d2f451 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 = ['name', "photo", "cost", "price", "sale", "stock", "view_cnt", "status", "content",]; + $fields = ["photo", 'user_uid', 'name', "cost", "price", "sale", "stock", "view_cnt", "content",]; switch ($action) { case "index": case "excel": - return ["user_uid", 'name', "photo", "cost", "price", "sale", "stock", "view_cnt", "status", "created_at"]; + return ["photo", "user_uid", 'name', "cost", "price", "sale", "stock", "view_cnt", "created_at"]; break; case "view": return [...$fields, "created_at"]; @@ -33,7 +33,7 @@ class ProductController extends FrontController } public function getFieldFilters(): array { - return ["user_uid", "status"]; + return ["user_uid"]; } public function getFieldBatchFilters(): array { diff --git a/app/Entities/ProductEntity.php b/app/Entities/ProductEntity.php index 98f3a8c..dea4e51 100644 --- a/app/Entities/ProductEntity.php +++ b/app/Entities/ProductEntity.php @@ -23,11 +23,14 @@ class ProductEntity extends BaseEntity } //추가기능 + public function getCategory_uid() + { + return $this->attributes['category_uid']; + } public function getUer_uid() { return $this->attributes['user_uid']; } - public function getCost() { return $this->attributes['cost']; @@ -40,10 +43,6 @@ class ProductEntity extends BaseEntity { return $this->attributes['sale']; } - public function getFinalPrice() - { - return $this->getPrice() - $this->getSale(); - } public function getPhoto() { return $this->attributes['photo']; diff --git a/app/Helpers/Product_helper.php b/app/Helpers/Product_helper.php index 0a61993..1122c50 100644 --- a/app/Helpers/Product_helper.php +++ b/app/Helpers/Product_helper.php @@ -79,9 +79,11 @@ function getFieldView_ProductHelper($field, $entity, array $viewDatas) break; case 'board_file': case 'upload_file': - 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 'photo': + return "getPhotoBlock() . "\">"; + break; case 'cost': case 'price': case 'sale': diff --git a/app/Language/ko/Product.php b/app/Language/ko/Product.php index 1f594d4..26cdcaa 100644 --- a/app/Language/ko/Product.php +++ b/app/Language/ko/Product.php @@ -4,7 +4,7 @@ return [ 'label' => [ 'uid' => "번호", 'category_uid' => "분류", - 'user_uid' => "생산자", + 'user_uid' => "판매자", 'name' => "상품명", 'photo' => "이미지", 'cost' => "원가", diff --git a/app/Views/front/product/addCart.php b/app/Views/front/product/addCart.php index 33fc04e..8bbf4b1 100644 --- a/app/Views/front/product/addCart.php +++ b/app/Views/front/product/addCart.php @@ -1,20 +1,20 @@ 'post']) ?> -getPrimaryKey()) ?> - +getPrimaryKey()) ?> + "구매수량 선택"]; -for ($i = 1; $i <= $entity->getStock(); $i++) { +for ($i = 1; $i <= $viewDatas['entity']->getStock(); $i++) { $quantityOptions[$i] = $i . "개"; } ?> 구매 수량 : "cal_price(this.options[this.selectedIndex].value)"]); ?> -구매 금액 : getPrice() - $entity->getSale()) * 1) ?>원 -getStock(), array("class" => "btn btn-outline btn-primary")); ?> +구매 금액 : getPrice() * 1) ?>원 +getStock(), array("class" => "btn btn-outline btn-primary")); ?>