From 8333a2cd0d0ecd4f58f4169be384e08ac75e4915 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Wed, 31 Jan 2024 11:46:11 +0800 Subject: [PATCH] update --- app/api/lists/FenceHouseLists.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/lists/FenceHouseLists.php b/app/api/lists/FenceHouseLists.php index 8c1e38d..30c9cad 100644 --- a/app/api/lists/FenceHouseLists.php +++ b/app/api/lists/FenceHouseLists.php @@ -16,6 +16,7 @@ namespace app\api\lists; use app\adminapi\lists\BaseAdminDataLists; +use app\common\model\farm\Farm; use app\common\model\fence_house\FenceHouse; use app\common\lists\ListsSearchInterface; @@ -55,7 +56,8 @@ class FenceHouseLists extends BaseApiDataLists implements ListsSearchInterface */ public function lists(): array { - return FenceHouse::where($this->searchWhere) + $farmIds = Farm::where('user_id', $this->userId)->column('id'); + return FenceHouse::where($this->searchWhere)->whereIn('farm_id', $farmIds) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()