From 6a679c466967d07bbe8ea0ea3dd98d93519ebe5f Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Mon, 29 Jan 2024 18:05:07 +0800 Subject: [PATCH] add --- app/api/controller/OperationLogController.php | 20 +++++++++++++++++++ app/api/lists/AnimalInfoLists.php | 1 + 2 files changed, 21 insertions(+) create mode 100644 app/api/controller/OperationLogController.php diff --git a/app/api/controller/OperationLogController.php b/app/api/controller/OperationLogController.php new file mode 100644 index 0000000..6a744da --- /dev/null +++ b/app/api/controller/OperationLogController.php @@ -0,0 +1,20 @@ +request->param('fence_house_id'); + $list = []; + $list[] = Db::name('operation_deworming_log')->where('fence_house_id', $fenceHouseId)->order('id desc')->find(); + $list[] = Db::name('operation_disinfect_log')->where('fence_house_id', $fenceHouseId)->order('id desc')->find(); + $list[] = Db::name('operation_feeding_log')->where('fence_house_id', $fenceHouseId)->order('id desc')->find(); + $list[] = Db::name('operation_vaccinum_log')->where('fence_house_id', $fenceHouseId)->order('id desc')->find(); + $list[] = Db::name('operation_water_log')->where('fence_house_id', $fenceHouseId)->order('id desc')->find(); + return $this->success('成功', $list); + } +} \ No newline at end of file diff --git a/app/api/lists/AnimalInfoLists.php b/app/api/lists/AnimalInfoLists.php index 8d1c79e..128e477 100644 --- a/app/api/lists/AnimalInfoLists.php +++ b/app/api/lists/AnimalInfoLists.php @@ -57,6 +57,7 @@ class AnimalInfoLists extends BaseApiDataLists implements ListsSearchInterface { return AnimalInfo::where($this->searchWhere) ->field(['id', 'fence_house_id', 'sn', 'animal_type', 'brand', 'physi_stage', 'gender', 'blood_purity', 'animal_source', 'current_estimation', 'algebra', 'birth', 'entry_date', 'birth_estimation', 'health_condition']) + ->with(['fenceHouseAttr']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()