shoppingmallv2 init...
This commit is contained in:
parent
8006e05983
commit
58b02cbdbb
@ -278,7 +278,9 @@ define('AUDIOS', [
|
||||
|
||||
//Default값 정의
|
||||
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",
|
||||
'STATUS' => getenv('default.status') ?: "use",
|
||||
'EMPTY' => getenv('default.empty') ?: "",
|
||||
|
||||
@ -20,7 +20,7 @@ class BillingController extends FrontController
|
||||
helper($this->_viewDatas['className']);
|
||||
|
||||
//Default 회원정보 Category
|
||||
$this->_category = DEFAULTS['CATEGORY'];
|
||||
$this->_category = DEFAULTS['CATEGORY_BILLING'];
|
||||
$this->isRole('index');
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ class BillingController extends FrontController
|
||||
}
|
||||
final public function getFieldFilters(): array
|
||||
{
|
||||
return ["user_uid", 'order_uid', "status"];
|
||||
return ['order_uid', "status"];
|
||||
}
|
||||
final public function getFieldBatchFilters(): array
|
||||
{
|
||||
|
||||
@ -26,7 +26,7 @@ class OrderController extends FrontController
|
||||
helper($this->_viewDatas['className']);
|
||||
|
||||
//Default 회원정보 Category
|
||||
$this->_category = DEFAULTS['CATEGORY'];
|
||||
$this->_category = DEFAULTS['CATEGORY_ORDER'];
|
||||
$this->isRole('index');
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ class UserController extends FrontController
|
||||
|
||||
$this->initAdapters();
|
||||
//Default 회원정보 Category
|
||||
$this->_category = DEFAULTS['CATEGORY'];
|
||||
$this->_category = DEFAULTS['CATEGORY_USER'];
|
||||
$this->isRole('index');
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ return [
|
||||
'order_uid' => "주문정보",
|
||||
'user_uid' => "사용자정보",
|
||||
'title' => "청구서명",
|
||||
'upload_file' => "청구서파일",
|
||||
'response' => "결제처리결과",
|
||||
'status' => "상태",
|
||||
'updated_at' => "수정일",
|
||||
|
||||
@ -7,7 +7,7 @@ use App\Entities\ProductEntity;
|
||||
|
||||
class BillingModel extends BaseModel
|
||||
{
|
||||
private $_product_options = null;
|
||||
private $_order_options = null;
|
||||
protected $table = "tw_order";
|
||||
protected $useAutoIncrement = false;
|
||||
protected $returnType = BillingEntity::class;
|
||||
@ -50,12 +50,12 @@ class BillingModel extends BaseModel
|
||||
public function getFieldFormOption(string $field): array
|
||||
{
|
||||
switch ($field) {
|
||||
case 'product_uid':
|
||||
if (is_null($this->_product_options)) {
|
||||
$productModel = new ProductModel();
|
||||
$this->_product_options = $productModel->getOptions();
|
||||
case 'order_uid':
|
||||
if (is_null($this->_order_options)) {
|
||||
$orderModel = new OrderModel();
|
||||
$this->_order_options = $orderModel->getOptions();
|
||||
}
|
||||
$options = $this->_product_options;
|
||||
$options = $this->_order_options;
|
||||
break;
|
||||
default:
|
||||
return parent::getFieldFormOption($field);
|
||||
@ -86,31 +86,4 @@ class BillingModel extends BaseModel
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
<div id="content">
|
||||
<div><?= html_entity_decode($viewDatas['category']->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">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -31,7 +30,6 @@
|
||||
<div class="bottom">
|
||||
<?= $viewDatas['pagination'] ?>
|
||||
</div>
|
||||
<?= form_close() ?>
|
||||
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -9,5 +9,8 @@
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/order"><?= CLASS_ICONS['ORDER'] ?></i>주문 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/billing"><?= CLASS_ICONS['BILLING'] ?></i>청구서 관리</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -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>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
<!-- DEBUG-VIEW ENDED 11 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||
|
||||
@ -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>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
<!-- DEBUG-VIEW ENDED 10 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||
|
||||
@ -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>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
<!-- DEBUG-VIEW ENDED 12 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user