diff --git a/app/api/controller/OperationLogController.php b/app/api/controller/OperationLogController.php index 8bfc783..5ab93b8 100644 --- a/app/api/controller/OperationLogController.php +++ b/app/api/controller/OperationLogController.php @@ -10,7 +10,10 @@ class OperationLogController extends BaseApiController public function index() { $fenceHouseId = $this->request->param('fence_house_id'); - $list = AnimalOperateAction::where('fence_house_id', $fenceHouseId)->order('id desc')->limit(5)->select()->toArray(); + $list = AnimalOperateAction::where('fence_house_id', $fenceHouseId)->order('id desc')->limit(5)->select()->each(function($item){ + $item['detail'] = json_decode($item['detail'],true); + return $item; + })->toArray(); return $this->success('成功', $list); } } \ No newline at end of file diff --git a/app/api/lists/suyuan_operation/OperationDewormingLogLists.php b/app/api/lists/suyuan_operation/OperationDewormingLogLists.php index 4f2a7ec..bc69424 100644 --- a/app/api/lists/suyuan_operation/OperationDewormingLogLists.php +++ b/app/api/lists/suyuan_operation/OperationDewormingLogLists.php @@ -61,6 +61,10 @@ class OperationDewormingLogLists extends BaseDataLists implements ListsSearchInt ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() + ->each(function($item){ + $item['detail'] = json_decode($item['detail'],true); + return $item; + }) ->toArray(); } diff --git a/app/api/lists/suyuan_operation/OperationDisinfectLogLists.php b/app/api/lists/suyuan_operation/OperationDisinfectLogLists.php index 2f98977..7e1ca62 100644 --- a/app/api/lists/suyuan_operation/OperationDisinfectLogLists.php +++ b/app/api/lists/suyuan_operation/OperationDisinfectLogLists.php @@ -61,6 +61,10 @@ class OperationDisinfectLogLists extends BaseDataLists implements ListsSearchInt ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() + ->each(function($item){ + $item['detail'] = json_decode($item['detail'],true); + return $item; + }) ->toArray(); } diff --git a/app/api/lists/suyuan_operation/OperationFeedingLogLists.php b/app/api/lists/suyuan_operation/OperationFeedingLogLists.php index b257a74..ce38d8e 100644 --- a/app/api/lists/suyuan_operation/OperationFeedingLogLists.php +++ b/app/api/lists/suyuan_operation/OperationFeedingLogLists.php @@ -62,6 +62,10 @@ class OperationFeedingLogLists extends BaseDataLists implements ListsSearchInter ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() + ->each(function($item){ + $item['detail'] = json_decode($item['detail'],true); + return $item; + }) ->toArray(); } diff --git a/app/api/lists/suyuan_operation/OperationVaccinumLogLists.php b/app/api/lists/suyuan_operation/OperationVaccinumLogLists.php index a6c4fad..db2cb43 100644 --- a/app/api/lists/suyuan_operation/OperationVaccinumLogLists.php +++ b/app/api/lists/suyuan_operation/OperationVaccinumLogLists.php @@ -61,6 +61,10 @@ class OperationVaccinumLogLists extends BaseDataLists implements ListsSearchInte ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() + ->each(function($item){ + $item['detail'] = json_decode($item['detail'],true); + return $item; + }) ->toArray(); } diff --git a/app/api/lists/suyuan_operation/OperationWaterLogLists.php b/app/api/lists/suyuan_operation/OperationWaterLogLists.php index 2857136..e6cc015 100644 --- a/app/api/lists/suyuan_operation/OperationWaterLogLists.php +++ b/app/api/lists/suyuan_operation/OperationWaterLogLists.php @@ -61,6 +61,10 @@ class OperationWaterLogLists extends BaseDataLists implements ListsSearchInterfa ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() + ->each(function($item){ + $item['detail'] = json_decode($item['detail'],true); + return $item; + }) ->toArray(); }