update
This commit is contained in:
parent
a0d5104838
commit
8333a2cd0d
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue