|
@@ -39,24 +39,10 @@ class GoodsReviewsLists extends BaseAdminDataLists implements ListsSearchInterfa
|
|
|
public function setSearch(): array
|
|
public function setSearch(): array
|
|
|
{
|
|
{
|
|
|
return [
|
|
return [
|
|
|
- '=' => ['goods_id', 'user_id', 'rating', 'comment', 'review_image', 'review_status', 'create_time', 'update_time'],
|
|
|
|
|
|
|
+ '=' => ['goods_id','goods_category_id', 'user_id', 'rating', 'comment', 'review_image', 'review_status', 'create_time', 'update_time'],
|
|
|
|
|
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- public function queryWhere()
|
|
|
|
|
- {
|
|
|
|
|
- $where = [];
|
|
|
|
|
- if (!empty($this->params['goods_category_id'])) {
|
|
|
|
|
- $goodsCategoryId = end($this->params['goods_category_id']);
|
|
|
|
|
- $goodsCategoryData = GoodsCategory::where(['status'=>1])->order(['pid' => 'asc','weigh' => 'desc', 'id' => 'desc'])
|
|
|
|
|
- ->select()->toArray();
|
|
|
|
|
- $ids =get_tree_ids($goodsCategoryData,$goodsCategoryId);
|
|
|
|
|
- $ids[] = $goodsCategoryId;
|
|
|
|
|
- $where[] = ['goods_category_id','in' ,$ids];
|
|
|
|
|
- }
|
|
|
|
|
- return $where;
|
|
|
|
|
- }
|
|
|
|
|
/**
|
|
/**
|
|
|
* @notes 获取列表
|
|
* @notes 获取列表
|
|
|
* @return array
|
|
* @return array
|
|
@@ -69,7 +55,6 @@ class GoodsReviewsLists extends BaseAdminDataLists implements ListsSearchInterfa
|
|
|
public function lists(): array
|
|
public function lists(): array
|
|
|
{
|
|
{
|
|
|
return GoodsReviews::where($this->searchWhere)
|
|
return GoodsReviews::where($this->searchWhere)
|
|
|
- ->where($this->queryWhere())
|
|
|
|
|
->field(['id', 'goods_id', 'goods_category_id', 'user_id', 'rating', 'comment', 'review_image', 'review_status', 'create_time', 'update_time'])
|
|
->field(['id', 'goods_id', 'goods_category_id', 'user_id', 'rating', 'comment', 'review_image', 'review_status', 'create_time', 'update_time'])
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
->order(['id' => 'desc'])
|
|
->order(['id' => 'desc'])
|
|
@@ -86,7 +71,7 @@ class GoodsReviewsLists extends BaseAdminDataLists implements ListsSearchInterfa
|
|
|
*/
|
|
*/
|
|
|
public function count(): int
|
|
public function count(): int
|
|
|
{
|
|
{
|
|
|
- return GoodsReviews::where($this->searchWhere)->where($this->queryWhere())->count();
|
|
|
|
|
|
|
+ return GoodsReviews::where($this->searchWhere)->count();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|