This commit is contained in:
chenbo 2024-02-03 13:52:43 +08:00
parent f8bd395277
commit f23c941217
5 changed files with 31 additions and 10 deletions

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}