shoppingmallv2 init...

This commit is contained in:
최준흠 2023-08-02 19:30:57 +09:00
parent 51095d5c20
commit d00efaa713
11 changed files with 15 additions and 13 deletions

View File

@ -124,8 +124,9 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->group('order', static function ($routes) {
$routes->get('', 'OrderController::index');
$routes->get('view/(:uuid)', 'OrderController::view/$1');
$routes->post('batchjob', 'OrderController::batchjob`');
$routes->get('delete/(:uuid)', 'OrderController::delete/$1', ['filter' => 'authFilter:master']);
$routes->get('toggle/(:uuid)/(:hash)', 'OrderController::toggle/$1/$2');
$routes->post('batchjob', 'OrderController::batchjob`');
});
});
$routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($routes) {

View File

@ -13,5 +13,5 @@ return [
'updated_at' => "수정일",
'created_at' => "작성일"
],
"STATUS" => ["use" => "결제", "unuse" => "주문취소", "confirm" => "주문완료",]
"STATUS" => ["use" => "주문신청", "unuse" => "주문취소", "confirm" => "주문완료",]
];

View File

@ -63,7 +63,10 @@ abstract class BaseModel extends Model
return $this->primaryKey;
}
abstract public function getTitleField(): string;
abstract public function getEntity($conditions): BaseEntity;
public function getEntity($conditions): BaseEntity
{
return $this->where($conditions)->first() ?: throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 해당 데이터가 없습니다.\n" . var_export($conditions, true));
}
final public function getEntitys(array $conditions = array()): array
{
return $this->where($conditions)->findAll();

View File

@ -50,7 +50,7 @@ class BoardConfigModel extends BaseModel
}
public function getEntity($conditions): BoardConfigEntity
{
return $this->where($conditions)->first() ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
return parent::getEntity($conditions);
}
protected function changeFormData(string $action, string $field, array $formDatas, $entity)

View File

@ -42,7 +42,7 @@ class CategoryModel extends BaseHierarchyModel
public function getEntity($conditions): CategoryEntity
{
return $this->where($conditions)->first() ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
return parent::getEntity($conditions);
}
public function getOptions(array $conditions = array(), $options = array()): array

View File

@ -62,7 +62,7 @@ class OrderModel extends BaseModel
}
public function getEntity($conditions): OrderEntity
{
return $this->where($conditions)->first() ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
return parent::getEntity($conditions);
}
public function create(array $formDatas): OrderEntity
{

View File

@ -84,7 +84,7 @@ class ProductModel extends BaseModel
public function getEntity($conditions): ProductEntity
{
return $this->where($conditions)->first() ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
return parent::getEntity($conditions);
}
public function create(array $formDatas): ProductEntity
{

View File

@ -53,7 +53,7 @@ class UserModel extends BaseModel
}
public function getEntity($conditions): UserEntity
{
return $this->where($conditions)->first() ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
return parent::getEntity($conditions);
}
protected function changeFormData(string $action, string $field, array $formDatas, $entity)

View File

@ -49,7 +49,7 @@ class UserSNSModel extends BaseModel
}
public function getEntity($conditions): UserSNSEntity
{
return $this->where($conditions)->first() ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
return parent::getEntity($conditions);
}
public function create(array $formDatas): UserSNSEntity

View File

@ -27,7 +27,7 @@
<td nowrap><?= getFieldIndex_Row_OrderHelper_Admin($field, $entity, $fieldFilters, $fieldFormOptions) ?></td>
<?php endforeach; ?>
<td>
<?= $entity->getStatus() == DEFAULTS['STATUS'] ? anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) : "" ?>
<?= $entity->getStatus() == DEFAULTS['STATUS'] ? anchor('cart/cancelCart/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) : "" ?>
</td>
</tr>
<?php $i++; ?>

View File

@ -25,9 +25,7 @@
<td nowrap><?= getFieldView_OrderHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?></td>
<?php endforeach; ?>
<td>
<?php if ($entity->getStatus() == DEFAULTS['STATUS']) : ?>
<?= anchor('cart/cancelCart/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
<?php endif; ?>
<?= $entity->getStatus() == DEFAULTS['STATUS'] ? anchor('cart/cancelCart/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) : "" ?>
</td>
</tr>
<?php $i++; ?>