diff --git a/app/api/lists/suyuan_operation/OperationDewormingLogLists.php b/app/api/lists/suyuan_operation/OperationDewormingLogLists.php index 554c9ed..7ca7e27 100644 --- a/app/api/lists/suyuan_operation/OperationDewormingLogLists.php +++ b/app/api/lists/suyuan_operation/OperationDewormingLogLists.php @@ -56,7 +56,9 @@ class OperationDewormingLogLists extends BaseDataLists implements ListsSearchInt */ public function lists(): array { - 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) + $animal_info_id = $this->request->get('animal_info_id', 0)? $this->request->get('animal_info_id'): 0; + $fence_house_id = $this->request->get('fence_house_id', 0)? $this->request->get('fence_house_id'): 0; + return AnimalOperateAction::whereRaw("animal_info_id = {$animal_info_id} or fence_house_id={$fence_house_id}")->where('type', 2) ->with(['fenceHouseAttr', 'animalInfo']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -77,7 +79,9 @@ class OperationDewormingLogLists extends BaseDataLists implements ListsSearchInt */ public function count(): int { - 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(); + $animal_info_id = $this->request->get('animal_info_id', 0)? $this->request->get('animal_info_id'): 0; + $fence_house_id = $this->request->get('fence_house_id', 0)? $this->request->get('fence_house_id'): 0; + return AnimalOperateAction::whereRaw("animal_info_id = {$animal_info_id} or fence_house_id={$fence_house_id}")->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 67bbde7..4d088c1 100644 --- a/app/api/lists/suyuan_operation/OperationDisinfectLogLists.php +++ b/app/api/lists/suyuan_operation/OperationDisinfectLogLists.php @@ -56,7 +56,9 @@ class OperationDisinfectLogLists extends BaseDataLists implements ListsSearchInt */ public function lists(): array { - 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) + $animal_info_id = $this->request->get('animal_info_id', 0)? $this->request->get('animal_info_id'): 0; + $fence_house_id = $this->request->get('fence_house_id', 0)? $this->request->get('fence_house_id'): 0; + return AnimalOperateAction::whereRaw("animal_info_id = {$animal_info_id} or fence_house_id={$fence_house_id}")->where('type', 1) ->with(['fenceHouseAttr', 'animalInfo']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -77,7 +79,9 @@ class OperationDisinfectLogLists extends BaseDataLists implements ListsSearchInt */ public function count(): int { - 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(); + $animal_info_id = $this->request->get('animal_info_id', 0)? $this->request->get('animal_info_id'): 0; + $fence_house_id = $this->request->get('fence_house_id', 0)? $this->request->get('fence_house_id'): 0; + return AnimalOperateAction::whereRaw("animal_info_id = {$animal_info_id} or fence_house_id={$fence_house_id}")->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 70c38fa..7c0fa33 100644 --- a/app/api/lists/suyuan_operation/OperationFeedingLogLists.php +++ b/app/api/lists/suyuan_operation/OperationFeedingLogLists.php @@ -57,7 +57,9 @@ class OperationFeedingLogLists extends BaseDataLists implements ListsSearchInter */ public function lists(): array { - 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) + $animal_info_id = $this->request->get('animal_info_id', 0)? $this->request->get('animal_info_id'): 0; + $fence_house_id = $this->request->get('fence_house_id', 0)? $this->request->get('fence_house_id'): 0; + $list = AnimalOperateAction::whereRaw("animal_info_id = {$animal_info_id} or fence_house_id={$fence_house_id}")->where('type', 3) ->with(['fenceHouseAttr', 'animalInfo']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -67,6 +69,7 @@ class OperationFeedingLogLists extends BaseDataLists implements ListsSearchInter return $item; }) ->toArray(); + return $list; } @@ -78,7 +81,9 @@ class OperationFeedingLogLists extends BaseDataLists implements ListsSearchInter */ public function count(): int { - 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(); + $animal_info_id = $this->request->get('animal_info_id', 0)? $this->request->get('animal_info_id'): 0; + $fence_house_id = $this->request->get('fence_house_id', 0)? $this->request->get('fence_house_id'): 0; + return AnimalOperateAction::whereRaw("animal_info_id = {$animal_info_id} or fence_house_id={$fence_house_id}")->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 1acf65c..f5cb43e 100644 --- a/app/api/lists/suyuan_operation/OperationVaccinumLogLists.php +++ b/app/api/lists/suyuan_operation/OperationVaccinumLogLists.php @@ -56,7 +56,9 @@ class OperationVaccinumLogLists extends BaseDataLists implements ListsSearchInte */ public function lists(): array { - 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) + $animal_info_id = $this->request->get('animal_info_id', 0)? $this->request->get('animal_info_id'): 0; + $fence_house_id = $this->request->get('fence_house_id', 0)? $this->request->get('fence_house_id'): 0; + return AnimalOperateAction::whereRaw("animal_info_id = {$animal_info_id} or fence_house_id={$fence_house_id}")->where('type', 4) ->with(['fenceHouseAttr', 'animalInfo']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -77,7 +79,9 @@ class OperationVaccinumLogLists extends BaseDataLists implements ListsSearchInte */ public function count(): int { - 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(); + $animal_info_id = $this->request->get('animal_info_id', 0)? $this->request->get('animal_info_id'): 0; + $fence_house_id = $this->request->get('fence_house_id', 0)? $this->request->get('fence_house_id'): 0; + return AnimalOperateAction::whereRaw("animal_info_id = {$animal_info_id} or fence_house_id={$fence_house_id}")->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 0129c8b..727c235 100644 --- a/app/api/lists/suyuan_operation/OperationWaterLogLists.php +++ b/app/api/lists/suyuan_operation/OperationWaterLogLists.php @@ -56,7 +56,9 @@ class OperationWaterLogLists extends BaseDataLists implements ListsSearchInterfa */ public function lists(): array { - 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) + $animal_info_id = $this->request->get('animal_info_id', 0)? $this->request->get('animal_info_id'): 0; + $fence_house_id = $this->request->get('fence_house_id', 0)? $this->request->get('fence_house_id'): 0; + return AnimalOperateAction::whereRaw("animal_info_id = {$animal_info_id} or fence_house_id={$fence_house_id}")->where('type', 5) ->with(['fenceHouseAttr', 'animalInfo']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -77,7 +79,9 @@ class OperationWaterLogLists extends BaseDataLists implements ListsSearchInterfa */ public function count(): int { - 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(); + $animal_info_id = $this->request->get('animal_info_id', 0)? $this->request->get('animal_info_id'): 0; + $fence_house_id = $this->request->get('fence_house_id', 0)? $this->request->get('fence_house_id'): 0; + return AnimalOperateAction::whereRaw("animal_info_id = {$animal_info_id} or fence_house_id={$fence_house_id}")->where('type', 5)->count(); } } \ No newline at end of file