From c610d058f31a6da39ac87c36817f361f0a8d0c12 Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Tue, 28 Dec 2021 21:10:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=B2=89=E4=B8=9D=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=BF=94=E5=9B=9E=E6=88=90=E9=95=BF=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Endpoint/Api/Http/Controllers/Account/FansController.php | 1 + app/Endpoint/Api/Http/Resources/FansResource.php | 1 + 2 files changed, 2 insertions(+) diff --git a/app/Endpoint/Api/Http/Controllers/Account/FansController.php b/app/Endpoint/Api/Http/Controllers/Account/FansController.php index 92266e90..40c6bc18 100644 --- a/app/Endpoint/Api/Http/Controllers/Account/FansController.php +++ b/app/Endpoint/Api/Http/Controllers/Account/FansController.php @@ -19,6 +19,7 @@ class FansController extends Controller { return response()->json([ 'fans_num'=>$request->user()->fans()->count(), + 'group_sales_value'=>$request->user()->userInfo->group_sales_value, ]); } diff --git a/app/Endpoint/Api/Http/Resources/FansResource.php b/app/Endpoint/Api/Http/Resources/FansResource.php index a66ef953..9bed0caa 100644 --- a/app/Endpoint/Api/Http/Resources/FansResource.php +++ b/app/Endpoint/Api/Http/Resources/FansResource.php @@ -18,6 +18,7 @@ class FansResource extends JsonResource 'phone' => $this->phone, 'nickname' => (string) $this->whenLoaded('userInfo', $this->userInfo->nickname, ''), 'avatar' => (string) $this->whenLoaded('userInfo', $this->userInfo->avatar, ''), + 'value' => (string) $this->whenLoaded('userInfo', $this->userInfo->growth_value + $this->userInfo->group_sales_value, 0), ]; } }