diff --git a/app/api/lists/suyuan_operation/OperationDewormingLogLists.php b/app/api/lists/suyuan_operation/OperationDewormingLogLists.php index bc69424..554c9ed 100644 --- a/app/api/lists/suyuan_operation/OperationDewormingLogLists.php +++ b/app/api/lists/suyuan_operation/OperationDewormingLogLists.php @@ -56,7 +56,7 @@ class OperationDewormingLogLists extends BaseDataLists implements ListsSearchInt */ public function lists(): array { - return AnimalOperateAction::where($this->searchWhere)->where('type', 2) + return AnimalOperateAction::whereRaw("animal_info_id = {$this->request->param('animal_info_id', 0)} or fence_house_id={$this->request->param('fence_house_id', 0)}")->where('type', 2) ->with(['fenceHouseAttr', 'animalInfo']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -77,7 +77,7 @@ class OperationDewormingLogLists extends BaseDataLists implements ListsSearchInt */ public function count(): int { - return AnimalOperateAction::where($this->searchWhere)->where('type', 2)->count(); + return AnimalOperateAction::whereRaw("animal_info_id = {$this->request->param('animal_info_id', 0)} or fence_house_id={$this->request->param('fence_house_id', 0)}")->where('type', 2)->count(); } } \ No newline at end of file diff --git a/app/api/lists/suyuan_operation/OperationDisinfectLogLists.php b/app/api/lists/suyuan_operation/OperationDisinfectLogLists.php index 7e1ca62..67bbde7 100644 --- a/app/api/lists/suyuan_operation/OperationDisinfectLogLists.php +++ b/app/api/lists/suyuan_operation/OperationDisinfectLogLists.php @@ -56,7 +56,7 @@ class OperationDisinfectLogLists extends BaseDataLists implements ListsSearchInt */ public function lists(): array { - return AnimalOperateAction::where($this->searchWhere)->where('type', 1) + return AnimalOperateAction::whereRaw("animal_info_id = {$this->request->param('animal_info_id', 0)} or fence_house_id={$this->request->param('fence_house_id', 0)}")->where('type', 1) ->with(['fenceHouseAttr', 'animalInfo']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -77,7 +77,7 @@ class OperationDisinfectLogLists extends BaseDataLists implements ListsSearchInt */ public function count(): int { - return AnimalOperateAction::where($this->searchWhere)->where('type', 1)->count(); + return AnimalOperateAction::whereRaw("animal_info_id = {$this->request->param('animal_info_id', 0)} or fence_house_id={$this->request->param('fence_house_id', 0)}")->where('type', 1)->count(); } } \ No newline at end of file diff --git a/app/api/lists/suyuan_operation/OperationFeedingLogLists.php b/app/api/lists/suyuan_operation/OperationFeedingLogLists.php index ce38d8e..70c38fa 100644 --- a/app/api/lists/suyuan_operation/OperationFeedingLogLists.php +++ b/app/api/lists/suyuan_operation/OperationFeedingLogLists.php @@ -57,7 +57,7 @@ class OperationFeedingLogLists extends BaseDataLists implements ListsSearchInter */ public function lists(): array { - return AnimalOperateAction::where($this->searchWhere)->where('type', 3) + return AnimalOperateAction::whereRaw("animal_info_id = {$this->request->param('animal_info_id', 0)} or fence_house_id={$this->request->param('fence_house_id', 0)}")->where('type', 3) ->with(['fenceHouseAttr', 'animalInfo']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -78,7 +78,7 @@ class OperationFeedingLogLists extends BaseDataLists implements ListsSearchInter */ public function count(): int { - return AnimalOperateAction::where($this->searchWhere)->where('type', 3)->count(); + return AnimalOperateAction::whereRaw("animal_info_id = {$this->request->param('animal_info_id', 0)} or fence_house_id={$this->request->param('fence_house_id', 0)}")->where('type', 3)->count(); } } \ No newline at end of file diff --git a/app/api/lists/suyuan_operation/OperationVaccinumLogLists.php b/app/api/lists/suyuan_operation/OperationVaccinumLogLists.php index db2cb43..1acf65c 100644 --- a/app/api/lists/suyuan_operation/OperationVaccinumLogLists.php +++ b/app/api/lists/suyuan_operation/OperationVaccinumLogLists.php @@ -56,7 +56,7 @@ class OperationVaccinumLogLists extends BaseDataLists implements ListsSearchInte */ public function lists(): array { - return AnimalOperateAction::where($this->searchWhere)->where('type', 4) + return AnimalOperateAction::whereRaw("animal_info_id = {$this->request->param('animal_info_id', 0)} or fence_house_id={$this->request->param('fence_house_id', 0)}")->where('type', 4) ->with(['fenceHouseAttr', 'animalInfo']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -77,7 +77,7 @@ class OperationVaccinumLogLists extends BaseDataLists implements ListsSearchInte */ public function count(): int { - return AnimalOperateAction::where($this->searchWhere)->where('type', 4)->count(); + return AnimalOperateAction::whereRaw("animal_info_id = {$this->request->param('animal_info_id', 0)} or fence_house_id={$this->request->param('fence_house_id', 0)}")->where('type', 4)->count(); } } \ No newline at end of file diff --git a/app/api/lists/suyuan_operation/OperationWaterLogLists.php b/app/api/lists/suyuan_operation/OperationWaterLogLists.php index e6cc015..0129c8b 100644 --- a/app/api/lists/suyuan_operation/OperationWaterLogLists.php +++ b/app/api/lists/suyuan_operation/OperationWaterLogLists.php @@ -56,7 +56,7 @@ class OperationWaterLogLists extends BaseDataLists implements ListsSearchInterfa */ public function lists(): array { - return AnimalOperateAction::where($this->searchWhere)->where('type', 5) + return AnimalOperateAction::whereRaw("animal_info_id = {$this->request->param('animal_info_id', 0)} or fence_house_id={$this->request->param('fence_house_id', 0)}")->where('type', 5) ->with(['fenceHouseAttr', 'animalInfo']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -77,7 +77,7 @@ class OperationWaterLogLists extends BaseDataLists implements ListsSearchInterfa */ public function count(): int { - return AnimalOperateAction::where($this->searchWhere)->where('type', 5)->count(); + return AnimalOperateAction::whereRaw("animal_info_id = {$this->request->param('animal_info_id', 0)} or fence_house_id={$this->request->param('fence_house_id', 0)}")->where('type', 5)->count(); } } \ No newline at end of file