|
@ -13,13 +13,13 @@ use backend\modules\shop\models\ars\Comment; |
|
|
class CommentSearch extends Comment |
|
|
class CommentSearch extends Comment |
|
|
{ |
|
|
{ |
|
|
/** |
|
|
/** |
|
|
* @return array |
|
|
|
|
|
* 增加创建时间查询字段 |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
* @return array |
|
|
|
|
|
* 增加创建时间查询字段 |
|
|
|
|
|
*/ |
|
|
public function attributes() |
|
|
public function attributes() |
|
|
{ |
|
|
|
|
|
return ArrayHelper::merge(['created_at_range'], parent::attributes()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
return ArrayHelper::merge(['created_at_range'], parent::attributes()); |
|
|
|
|
|
} |
|
|
/** |
|
|
/** |
|
|
* {@inheritdoc} |
|
|
* {@inheritdoc} |
|
|
*/ |
|
|
*/ |
|
@ -41,14 +41,14 @@ class CommentSearch extends Comment |
|
|
return Model::scenarios(); |
|
|
return Model::scenarios(); |
|
|
} |
|
|
} |
|
|
/** |
|
|
/** |
|
|
* @return array |
|
|
|
|
|
* 列格式 |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
* @return array |
|
|
|
|
|
* 列格式 |
|
|
|
|
|
*/ |
|
|
public function columns() |
|
|
public function columns() |
|
|
{ |
|
|
{ |
|
|
return [ |
|
|
return [ |
|
|
'id', |
|
|
|
|
|
'user_id', |
|
|
|
|
|
|
|
|
'id', |
|
|
|
|
|
'user_id', |
|
|
[ |
|
|
[ |
|
|
'attribute' => 'order_goods_id', |
|
|
'attribute' => 'order_goods_id', |
|
|
'value' => function ($model) { |
|
|
'value' => function ($model) { |
|
@ -56,8 +56,8 @@ class CommentSearch extends Comment |
|
|
}, |
|
|
}, |
|
|
'label' => '商品名称' |
|
|
'label' => '商品名称' |
|
|
], |
|
|
], |
|
|
'star', |
|
|
|
|
|
'content', |
|
|
|
|
|
|
|
|
'star', |
|
|
|
|
|
'content', |
|
|
[ |
|
|
[ |
|
|
'attribute' => 'status', |
|
|
'attribute' => 'status', |
|
|
'value' => function ($model) { |
|
|
'value' => function ($model) { |
|
@ -65,7 +65,7 @@ class CommentSearch extends Comment |
|
|
}, |
|
|
}, |
|
|
'label' => '状态' |
|
|
'label' => '状态' |
|
|
], |
|
|
], |
|
|
'created_at:datetime', |
|
|
|
|
|
|
|
|
'created_at:datetime', |
|
|
[ |
|
|
[ |
|
|
'class' => 'iron\grid\ActionColumn', |
|
|
'class' => 'iron\grid\ActionColumn', |
|
|
'align' => 'center', |
|
|
'align' => 'center', |
|
@ -106,10 +106,10 @@ class CommentSearch extends Comment |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
/** |
|
|
/** |
|
|
* @param $params |
|
|
|
|
|
* @return ActiveDataProvider |
|
|
|
|
|
* 不分页的所有数据 |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
* @param $params |
|
|
|
|
|
* @return ActiveDataProvider |
|
|
|
|
|
* 不分页的所有数据 |
|
|
|
|
|
*/ |
|
|
public function allData($params) |
|
|
public function allData($params) |
|
|
{ |
|
|
{ |
|
|
$query = Comment::find(); |
|
|
$query = Comment::find(); |
|
@ -151,11 +151,11 @@ class CommentSearch extends Comment |
|
|
return $this->filter($query, $dataProvider); |
|
|
return $this->filter($query, $dataProvider); |
|
|
} |
|
|
} |
|
|
/** |
|
|
/** |
|
|
* @param $query |
|
|
|
|
|
* @param $dataProvider |
|
|
|
|
|
* @return ActiveDataProvider |
|
|
|
|
|
* 条件筛选 |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
* @param $query |
|
|
|
|
|
* @param $dataProvider |
|
|
|
|
|
* @return ActiveDataProvider |
|
|
|
|
|
* 条件筛选 |
|
|
|
|
|
*/ |
|
|
private function filter($query, $dataProvider){ |
|
|
private function filter($query, $dataProvider){ |
|
|
if (!$this->validate()) { |
|
|
if (!$this->validate()) { |
|
|
// uncomment the following line if you do not want to return any records when validation fails
|
|
|
// uncomment the following line if you do not want to return any records when validation fails
|
|
|