Browse Source

feat:隐藏批量操作和添加按钮,修改评论列表字段显示

antshop
linyaostalker 5 years ago
parent
commit
0bd18c2ffa
  1. 19
      backend/modules/shop/models/searchs/CommentSearch.php
  2. 23
      backend/modules/shop/views/comment/index.php

19
backend/modules/shop/models/searchs/CommentSearch.php

@ -54,12 +54,23 @@ class CommentSearch extends Comment
],
'id',
'user_id',
'order_goods_id',
[
'attribute' => 'order_goods_id',
'value' => function ($model) {
return $model->orderGoods->goods_name;
},
'label' => '商品名称'
],
'star',
'content',
//'status',
//'updated_at',
//'created_at',
[
'attribute' => 'status',
'value' => function ($model) {
return Comment::$commentStatus[$model->status];
},
'label' => '状态'
],
'created_at',
[
'class' => 'iron\grid\ActionColumn',
'align' => 'center',

23
backend/modules/shop/views/comment/index.php

@ -7,22 +7,25 @@ use iron\grid\GridView;
/* @var $searchModel backend\modules\shop\models\searchs\CommentSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Comments';
$this->title = '评论';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
<div class="col-12">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filter' => $this->render("_search", ['model' => $searchModel]),
'batch' => [
[
"label" => "删除",
"url" => "comment/deletes"
],
'dataProvider' => $dataProvider,
'filter' => $this->render("_search", ['model' => $searchModel]),
'batch' => [
[
"label" => "删除",
"url" => "comment/deletes"
],
'columns' => $columns
]);
],
'columns' => $columns,
'batchTemplate' => '',
'create' => '',
'export' => '',
]);
?>
</div>
</div>
Loading…
Cancel
Save