Browse Source

修复全部完成

wechat_public_accounts
blobt 5 years ago
parent
commit
38f4c4aea9
  1. 3
      kcadmin/views/category/index.php
  2. 9
      vendor/blobt/grid/DataColumn.php

3
kcadmin/views/category/index.php

@ -61,10 +61,11 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'description', 'attribute' => 'description',
'enableSorting' => false, 'enableSorting' => false,
'format' => 'ntext', 'format' => 'ntext',
'width' => '49%',
'width' => '55%',
], ],
[ [
'class' => 'blobt\grid\ActionColumn', 'class' => 'blobt\grid\ActionColumn',
'align' => 'center'
], ],
], ],
]); ]);

9
vendor/blobt/grid/DataColumn.php

@ -175,7 +175,14 @@ class DataColumn extends Column {
return call_user_func($this->value, $model, $key, $index, $this); return call_user_func($this->value, $model, $key, $index, $this);
} elseif ($this->attribute !== null) { } elseif ($this->attribute !== null) {
return ArrayHelper::getValue($model, $this->attribute);
$val = ArrayHelper::getValue($model, $this->attribute);
if ($this->showConstText) {
$constArrKey = Inflector::variablize($this->attribute, '_');
if (isset($model::$$constArrKey)) {
$val = $model::$$constArrKey[$val];
}
}
return $val;
} }
return null; return null;

Loading…
Cancel
Save