shoppingmallv2 init...

This commit is contained in:
최준흠 2023-08-16 14:07:07 +09:00
parent 8006e05983
commit 58b02cbdbb
11 changed files with 20 additions and 43 deletions

View File

@ -278,7 +278,9 @@ define('AUDIOS', [
//Default값 정의 //Default값 정의
define('DEFAULTS', [ define('DEFAULTS', [
'CATEGORY' => getenv('default.category') ?: 22, 'CATEGORY_USER' => getenv('default.category.user') ?: 22,
'CATEGORY_ORDER' => getenv('default.category.order') ?: 11,
'CATEGORY_BILLING' => getenv('default.category.billing') ?: 28,
'ROLE' => getenv('default.role') ?: "guest", 'ROLE' => getenv('default.role') ?: "guest",
'STATUS' => getenv('default.status') ?: "use", 'STATUS' => getenv('default.status') ?: "use",
'EMPTY' => getenv('default.empty') ?: "", 'EMPTY' => getenv('default.empty') ?: "",

View File

@ -20,7 +20,7 @@ class BillingController extends FrontController
helper($this->_viewDatas['className']); helper($this->_viewDatas['className']);
//Default 회원정보 Category //Default 회원정보 Category
$this->_category = DEFAULTS['CATEGORY']; $this->_category = DEFAULTS['CATEGORY_BILLING'];
$this->isRole('index'); $this->isRole('index');
} }
@ -44,7 +44,7 @@ class BillingController extends FrontController
} }
final public function getFieldFilters(): array final public function getFieldFilters(): array
{ {
return ["user_uid", 'order_uid', "status"]; return ['order_uid', "status"];
} }
final public function getFieldBatchFilters(): array final public function getFieldBatchFilters(): array
{ {

View File

@ -26,7 +26,7 @@ class OrderController extends FrontController
helper($this->_viewDatas['className']); helper($this->_viewDatas['className']);
//Default 회원정보 Category //Default 회원정보 Category
$this->_category = DEFAULTS['CATEGORY']; $this->_category = DEFAULTS['CATEGORY_ORDER'];
$this->isRole('index'); $this->isRole('index');
} }

View File

@ -23,7 +23,7 @@ class UserController extends FrontController
$this->initAdapters(); $this->initAdapters();
//Default 회원정보 Category //Default 회원정보 Category
$this->_category = DEFAULTS['CATEGORY']; $this->_category = DEFAULTS['CATEGORY_USER'];
$this->isRole('index'); $this->isRole('index');
} }

View File

@ -6,6 +6,7 @@ return [
'order_uid' => "주문정보", 'order_uid' => "주문정보",
'user_uid' => "사용자정보", 'user_uid' => "사용자정보",
'title' => "청구서명", 'title' => "청구서명",
'upload_file' => "청구서파일",
'response' => "결제처리결과", 'response' => "결제처리결과",
'status' => "상태", 'status' => "상태",
'updated_at' => "수정일", 'updated_at' => "수정일",

View File

@ -7,7 +7,7 @@ use App\Entities\ProductEntity;
class BillingModel extends BaseModel class BillingModel extends BaseModel
{ {
private $_product_options = null; private $_order_options = null;
protected $table = "tw_order"; protected $table = "tw_order";
protected $useAutoIncrement = false; protected $useAutoIncrement = false;
protected $returnType = BillingEntity::class; protected $returnType = BillingEntity::class;
@ -50,12 +50,12 @@ class BillingModel extends BaseModel
public function getFieldFormOption(string $field): array public function getFieldFormOption(string $field): array
{ {
switch ($field) { switch ($field) {
case 'product_uid': case 'order_uid':
if (is_null($this->_product_options)) { if (is_null($this->_order_options)) {
$productModel = new ProductModel(); $orderModel = new OrderModel();
$this->_product_options = $productModel->getOptions(); $this->_order_options = $orderModel->getOptions();
} }
$options = $this->_product_options; $options = $this->_order_options;
break; break;
default: default:
return parent::getFieldFormOption($field); return parent::getFieldFormOption($field);
@ -86,31 +86,4 @@ class BillingModel extends BaseModel
$this->orLike($this->getTitleField(), $word, "both"); $this->orLike($this->getTitleField(), $word, "both");
} }
} }
//장바구니에 넣기()
final public function addCart(ProductEntity $entity, int $quantity, $paymentDay = null): BillingEntity
{
$formDatas = [];
$formDatas['product_uid'] = $entity->getPrimaryKey();
//상품명을 복사해서 구매한 상품명에 넣기
$formDatas[$this->getTitleField()] = $entity->getTitle();
$formDatas['cost'] = $entity->price;
$formDatas['sale'] = 0;
$formDatas['quantity'] = $quantity;
$formDatas['price'] = $formDatas['cost'] * $formDatas['quantity'];
if (!is_null($paymentDay)) {
$formDatas['paymentday'] = $paymentDay;
}
return $this->create($formDatas);
}
//장바구니에 빼기
public function cancelCart(BillingEntity $entity)
{
$formDatas = array();
//장바구니인경우에만
if ($entity->status == DEFAULTS['STATUS']) {
$formDatas['status'] = 'unuse';
}
return $this->modify($entity, $formDatas);
}
} }

View File

@ -4,7 +4,6 @@
<div id="content"> <div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div> <div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div class="top"><?= $this->include('templates/front/index_head') ?></div> <div class="top"><?= $this->include('templates/front/index_head') ?></div>
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
@ -31,7 +30,6 @@
<div class="bottom"> <div class="bottom">
<?= $viewDatas['pagination'] ?> <?= $viewDatas['pagination'] ?>
</div> </div>
<?= form_close() ?>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div> <div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
</div> </div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -9,5 +9,8 @@
<div class="accordion-item"> <div class="accordion-item">
<h2><a href="/admin/order"><?= CLASS_ICONS['ORDER'] ?></i>주문 관리</a></h2> <h2><a href="/admin/order"><?= CLASS_ICONS['ORDER'] ?></i>주문 관리</a></h2>
</div> </div>
<div class="accordion-item">
<h2><a href="/admin/billing"><?= CLASS_ICONS['BILLING'] ?></i>청구서 관리</a></h2>
</div>
</div> </div>
</div> </div>

View File

@ -10,7 +10,7 @@
<a href="http://localhost:8080/front/order?category=11" target="_self">주문정보</a> <span class="play"><i class="bi bi-play-fill"></i></span> <a href="http://localhost:8080/front/order?category=11" target="_self">주문정보</a> <span class="play"><i class="bi bi-play-fill"></i></span>
</div> </div>
<div class="sibling "> <div class="sibling ">
<a href="http://localhost:8080/front/order?category=28" target="_self">청구서정보</a> <span class="play"><i class="bi bi-play-fill"></i></span> <a href="http://localhost:8080/front/billing?category=28" target="_self">청구서정보</a> <span class="play"><i class="bi bi-play-fill"></i></span>
</div> </div>
<!-- DEBUG-VIEW ENDED 11 APPPATH\Views\admin\category\leftmenu_template.php --> <!-- DEBUG-VIEW ENDED 11 APPPATH\Views\admin\category\leftmenu_template.php -->

View File

@ -10,7 +10,7 @@
<a href="http://localhost:8080/front/order?category=11" target="_self">주문정보</a> <span class="play"><i class="bi bi-play-fill"></i></span> <a href="http://localhost:8080/front/order?category=11" target="_self">주문정보</a> <span class="play"><i class="bi bi-play-fill"></i></span>
</div> </div>
<div class="sibling "> <div class="sibling ">
<a href="http://localhost:8080/front/order?category=28" target="_self">청구서정보</a> <span class="play"><i class="bi bi-play-fill"></i></span> <a href="http://localhost:8080/front/billing?category=28" target="_self">청구서정보</a> <span class="play"><i class="bi bi-play-fill"></i></span>
</div> </div>
<!-- DEBUG-VIEW ENDED 10 APPPATH\Views\admin\category\leftmenu_template.php --> <!-- DEBUG-VIEW ENDED 10 APPPATH\Views\admin\category\leftmenu_template.php -->

View File

@ -10,7 +10,7 @@
<a href="http://localhost:8080/front/order?category=11" target="_self">주문정보</a> <span class="play"><i class="bi bi-play-fill"></i></span> <a href="http://localhost:8080/front/order?category=11" target="_self">주문정보</a> <span class="play"><i class="bi bi-play-fill"></i></span>
</div> </div>
<div class="sibling active"> <div class="sibling active">
<a href="http://localhost:8080/front/order?category=28" target="_self">청구서정보</a> <span class="play"><i class="bi bi-play-fill"></i></span> <a href="http://localhost:8080/front/billing?category=28" target="_self">청구서정보</a> <span class="play"><i class="bi bi-play-fill"></i></span>
</div> </div>
<!-- DEBUG-VIEW ENDED 12 APPPATH\Views\admin\category\leftmenu_template.php --> <!-- DEBUG-VIEW ENDED 12 APPPATH\Views\admin\category\leftmenu_template.php -->