shoppingmallv2 init...
This commit is contained in:
parent
e96de32a6c
commit
de896074a3
@ -112,7 +112,7 @@ abstract class BaseModel extends Model
|
|||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
//Field별 Form Option용
|
//Field별 Form Option용
|
||||||
public function getFormOptions(array $conditions = array(), $options = array()): array
|
public function getOptions(array $conditions = array(), $options = array()): array
|
||||||
{
|
{
|
||||||
foreach ($this->getEntitys($conditions) as $entity) {
|
foreach ($this->getEntitys($conditions) as $entity) {
|
||||||
$options[$entity->getPrimaryKey()] = $entity->getTitle();
|
$options[$entity->getPrimaryKey()] = $entity->getTitle();
|
||||||
@ -125,7 +125,7 @@ abstract class BaseModel extends Model
|
|||||||
case 'user_uid':
|
case 'user_uid':
|
||||||
if (is_null($this->_user_options)) {
|
if (is_null($this->_user_options)) {
|
||||||
$userModel = new UserModel([$this->getPrimaryKey(), $this->getTitleField()]);
|
$userModel = new UserModel([$this->getPrimaryKey(), $this->getTitleField()]);
|
||||||
$this->_user_options = $userModel->getFormOptions();
|
$this->_user_options = $userModel->getOptions();
|
||||||
}
|
}
|
||||||
$options = $this->_user_options;
|
$options = $this->_user_options;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class BoardModel extends BaseHierarchyModel
|
|||||||
case 'board_config_uid':
|
case 'board_config_uid':
|
||||||
if (is_null($this->_boardconfig_options)) {
|
if (is_null($this->_boardconfig_options)) {
|
||||||
$boardConfigModel = new BoardConfigModel([$this->getPrimaryKey(), $this->getTitleField()]);
|
$boardConfigModel = new BoardConfigModel([$this->getPrimaryKey(), $this->getTitleField()]);
|
||||||
$this->_boardconfig_options = $boardConfigModel->getFormOptions();
|
$this->_boardconfig_options = $boardConfigModel->getOptions();
|
||||||
}
|
}
|
||||||
$options = $this->_boardconfig_options;
|
$options = $this->_boardconfig_options;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class CategoryModel extends BaseHierarchyModel
|
|||||||
return $this->where($conditions)->first() ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
|
return $this->where($conditions)->first() ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormOptions(array $conditions = array(), $options = array()): array
|
public function getOptions(array $conditions = array(), $options = array()): array
|
||||||
{
|
{
|
||||||
$old_title = "";
|
$old_title = "";
|
||||||
foreach ($this->where($conditions)->orderby("grpno DESC, grporder ASC")->findAll() as $entity) {
|
foreach ($this->where($conditions)->orderby("grpno DESC, grporder ASC")->findAll() as $entity) {
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class OrderModel extends BaseModel
|
|||||||
case 'product_uid':
|
case 'product_uid':
|
||||||
if (is_null($this->_product_options)) {
|
if (is_null($this->_product_options)) {
|
||||||
$productModel = new productModel([$this->getPrimaryKey(), 'product_uid']);
|
$productModel = new productModel([$this->getPrimaryKey(), 'product_uid']);
|
||||||
$this->_product_options = $productModel->getFormOptions();
|
$this->_product_options = $productModel->getOptions();
|
||||||
}
|
}
|
||||||
$options = $this->_product_options;
|
$options = $this->_product_options;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class ProductModel extends BaseModel
|
|||||||
case 'category_uid':
|
case 'category_uid':
|
||||||
if (is_null($this->_category_options)) {
|
if (is_null($this->_category_options)) {
|
||||||
$categoryModel = new CategoryModel([$this->getPrimaryKey(), $this->getTitleField()]);
|
$categoryModel = new CategoryModel([$this->getPrimaryKey(), $this->getTitleField()]);
|
||||||
$this->_category_options = $categoryModel->getFormOptions();
|
$this->_category_options = $categoryModel->getOptions();
|
||||||
}
|
}
|
||||||
$options = $this->_category_options;
|
$options = $this->_category_options;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user