|
|
@@ -29,6 +29,16 @@ class HomeSpecialLists extends BaseApiDataLists implements ListsSearchInterface
|
|
|
];
|
|
|
}
|
|
|
|
|
|
+ public function queryWhere()
|
|
|
+ {
|
|
|
+ $where = [];
|
|
|
+ if (!empty($this->params['id'])) {
|
|
|
+ $where[] = ['id','>',$this->params['id']];
|
|
|
+ $where[] = ['cover_type','=',1];
|
|
|
+ }
|
|
|
+ return $where;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @notes 获取列表
|
|
|
@@ -41,7 +51,9 @@ class HomeSpecialLists extends BaseApiDataLists implements ListsSearchInterface
|
|
|
*/
|
|
|
public function lists(): array
|
|
|
{
|
|
|
+
|
|
|
return HomeSpecial::where($this->searchWhere)
|
|
|
+ ->where($this->queryWhere())
|
|
|
->where('status',1)
|
|
|
->field(['id', 'special_type','special_way', 'title', 'cover_type', 'cover', 'user_head', 'user_nickname', 'vue_web', 'vue_param', 'view_num', 'tags', 'status', 'original_price' ,'present_price','goods_id'])
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
@@ -64,7 +76,7 @@ class HomeSpecialLists extends BaseApiDataLists implements ListsSearchInterface
|
|
|
*/
|
|
|
public function count(): int
|
|
|
{
|
|
|
- return HomeSpecial::where($this->searchWhere)->count();
|
|
|
+ return HomeSpecial::where($this->searchWhere)->where($this->queryWhere())->count();
|
|
|
}
|
|
|
|
|
|
}
|