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), ]; } }