From d2aa8d0817ada2192be0b923c525974e7c7b33fe Mon Sep 17 00:00:00 2001 From: Anyon Date: Thu, 10 Feb 2022 13:54:26 +0800 Subject: [PATCH] Update FansService.php --- app/wechat/service/FansService.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/wechat/service/FansService.php b/app/wechat/service/FansService.php index fe93fd893..f92138395 100644 --- a/app/wechat/service/FansService.php +++ b/app/wechat/service/FansService.php @@ -54,13 +54,9 @@ class FansService extends Service * 获取粉丝信息 * @param string $openid * @return array - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException */ public function get(string $openid): array { - $user = WechatFans::mk()->where(['openid' => $openid])->find(); - return empty($user) ? [] : $user->toArray(); + return WechatFans::mk()->where(['openid' => $openid])->findOrEmpty()->toArray(); } }