This commit is contained in:
chenbo 2024-01-31 11:46:11 +08:00
parent a0d5104838
commit 8333a2cd0d
1 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,7 @@ namespace app\api\lists;
use app\adminapi\lists\BaseAdminDataLists; use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\farm\Farm;
use app\common\model\fence_house\FenceHouse; use app\common\model\fence_house\FenceHouse;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
@ -55,7 +56,8 @@ class FenceHouseLists extends BaseApiDataLists implements ListsSearchInterface
*/ */
public function lists(): array 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) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select() ->select()