shoppingmallv2 init...

This commit is contained in:
최준흠 2023-08-10 12:22:08 +09:00
parent 7340071493
commit e2acba3aca
5 changed files with 47 additions and 23 deletions

View File

@ -24,6 +24,8 @@ class OrderController extends AdminController
break;
case "index":
case "excel":
return ["user_uid", "name", "cost", "sale", "quantity", "price", "status", "updated_at", "created_at"];
break;
case "view":
return ["user_uid", 'product_uid', "name", "cost", "sale", "quantity", "price", "status", "updated_at", "created_at"];
break;

View File

@ -15,4 +15,13 @@ class OrderEntity extends BaseEntity
return $this->attributes['name'];
}
//추가기능
public function getOrderHint()
{
$hints = explode("-", $this->getPrimaryKey());
return sprintf(
"%s-**-%s",
str_split($hints[0], 3)[0],
str_split($hints[count($hints) - 1], 5)[0]
);
}
}

View File

@ -109,10 +109,15 @@ function getFieldIndex_Row_OrderHelper($field, $entity, array $viewDatas): strin
switch ($field) {
case 'title':
case 'name':
return anchor(
current_url() . '/view/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(),
$value,
["target" => "_self"]
return sprintf(
"<div class=\"location-left\">%s : %s</div>%s",
lang("{$viewDatas['className']}.label.uid"),
$entity->getOrderHint(),
anchor(
current_url() . '/view/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(),
$value,
["target" => "_self"]
)
);
break;
default:
@ -127,23 +132,29 @@ function getFieldIndex_Row_OrderHelper_Admin($field, $entity, array $viewDatas):
switch ($field) {
case 'title':
case 'name':
return anchor(
current_url() . '/view/' . $entity->getPrimaryKey(),
$value,
["target" => "_self"]
return sprintf(
"<div class=\"location-left\">%s : %s</div>%s",
lang("{$viewDatas['className']}.label.uid"),
$entity->getPrimaryKey(),
anchor(
current_url() . '/view/' . $entity->getPrimaryKey(),
$value,
["target" => "_self"]
)
);
break;
default:
if (in_array($field, $viewDatas['fieldFilters'])) {
$attributes["onChange"] = sprintf(
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
current_url(),
$entity->getPrimaryKey(),
$field,
$field
);
return getFieldForm_OrderHelper($field, $entity->$field, $viewDatas, $attributes);
}
//관리자도 수정할수 없게 하기위해
// if (in_array($field, $viewDatas['fieldFilters'])) {
// $attributes["onChange"] = sprintf(
// 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
// current_url(),
// $entity->getPrimaryKey(),
// $field,
// $field
// );
// return getFieldForm_OrderHelper($field, $entity->$field, $viewDatas, $attributes);
// }
return getFieldIndex_Row_OrderHelper($field, $entity, $viewDatas);
break;
}

View File

@ -2,7 +2,7 @@
return [
'title' => "주문 정보",
'label' => [
'uid' => "번호",
'uid' => "주문ID",
'product_uid' => "상품정보",
'sess_id' => "세션ID",
'user_uid' => "사용자정보",

View File

@ -14,13 +14,13 @@
font: Arial;
}
/* user class */
h1,h2,h3,h4,h5,h6,strong,th,.bold{font-weight:500;}
body {
background-color: white;
}
/* user class */
h1,h2,h3,h4,h5,h6,strong,th,.bold{font-weight:500;}
input[type=text],input[type=password]{
display: inline-block;
border: 1px solid #ccc;
@ -38,4 +38,6 @@ select,textarea,button {
a:link { text-decoration: none; }
a:visited { text-decoration: none; }
a:hover { text-decoration: underline; }
a:active { text-decoration: underline; }
a:active { text-decoration: underline; }
div.location-left { text-align:left; }