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; break;
case "index": case "index":
case "excel": case "excel":
return ["user_uid", "name", "cost", "sale", "quantity", "price", "status", "updated_at", "created_at"];
break;
case "view": case "view":
return ["user_uid", 'product_uid', "name", "cost", "sale", "quantity", "price", "status", "updated_at", "created_at"]; return ["user_uid", 'product_uid', "name", "cost", "sale", "quantity", "price", "status", "updated_at", "created_at"];
break; break;

View File

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

View File

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

View File

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