|
|
@@ -40,12 +40,9 @@ class GoodsSpecPriceLists extends BaseAdminDataLists implements ListsSearchInter
|
|
|
*/
|
|
|
public function setSearch(): array
|
|
|
{
|
|
|
-// return [
|
|
|
-// '=' => [ 'g.category_id', 'g.status', 'g.supplier_id', 'g.goods_type'],
|
|
|
-// 'like' => ['g.name', 'g.code', 'gi.bar_code'],
|
|
|
-// 'between_time' => ['g.create_time'],
|
|
|
-// ];
|
|
|
- return array_intersect(array_keys($this->params),['bar_code', 'type','keyword','category_id','supplier_id','goods_type','activity_type']);
|
|
|
+ return array_intersect(array_keys($this->params), [
|
|
|
+ 'bar_code', 'keyword', 'category_id', 'supplier_id', 'goods_type', 'status'
|
|
|
+ ]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -56,9 +53,9 @@ class GoodsSpecPriceLists extends BaseAdminDataLists implements ListsSearchInter
|
|
|
*/
|
|
|
public function lists(): array
|
|
|
{
|
|
|
- $lists = GoodsItem::alias('gi')
|
|
|
- ->leftJoin('goods g', 'g.id = gi.goods_id')
|
|
|
- ->where($this->searchWhere)
|
|
|
+ $lists = Goods::alias('g')
|
|
|
+ ->leftJoin('goods_item gi', 'g.id = gi.goods_id')
|
|
|
+ ->withSearch($this->setSearch(), $this->params)
|
|
|
->where('g.delete_time', null)
|
|
|
->field([
|
|
|
'g.id as goods_id',
|
|
|
@@ -89,9 +86,9 @@ class GoodsSpecPriceLists extends BaseAdminDataLists implements ListsSearchInter
|
|
|
*/
|
|
|
public function count(): int
|
|
|
{
|
|
|
- return GoodsItem::alias('gi')
|
|
|
- ->leftJoin('goods g', 'g.id = gi.goods_id')
|
|
|
- ->where($this->searchWhere)
|
|
|
+ return Goods::alias('g')
|
|
|
+ ->leftJoin('goods_item gi', 'g.id = gi.goods_id')
|
|
|
+ ->withSearch($this->setSearch(), $this->params)
|
|
|
->where('g.delete_time', null)
|
|
|
->count();
|
|
|
}
|