6
0
Fork 0

添加粉丝列表返回成长值

release
vine_liutk 2021-12-28 21:10:35 +08:00
parent 93795a8c40
commit c610d058f3
2 changed files with 2 additions and 0 deletions

View File

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

View File

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