From 5bb4554bf4e41a40303199b85d6a0b07d96060cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Sun, 8 May 2022 19:21:58 +0800 Subject: [PATCH] Update Address.php --- app/data/controller/api/auth/Address.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/data/controller/api/auth/Address.php b/app/data/controller/api/auth/Address.php index bea040978..9c6eadb6c 100644 --- a/app/data/controller/api/auth/Address.php +++ b/app/data/controller/api/auth/Address.php @@ -76,9 +76,6 @@ class Address extends Auth /** * 修改地址状态 - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException */ public function state() { @@ -129,14 +126,10 @@ class Address extends Auth * 获取指定的地址 * @param string $code * @return null|array - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException */ private function _getAddress(string $code): array { $map = ['code' => $code, 'uuid' => $this->uuid, 'deleted' => 0]; - $data = DataUserAddress::mk()->withoutField('deleted')->where($map)->find(); - return empty($data) ? [] : $data->toArray(); + return DataUserAddress::mk()->withoutField('deleted')->where($map)->findOrEmpty()->toArray(); } } \ No newline at end of file