|
|
@@ -893,10 +893,48 @@ class Auth extends BaseController
|
|
893
|
893
|
|
|
894
|
894
|
// 是否共富体系会员
|
|
895
|
895
|
$isSharedProsperity = false;
|
|
896
|
|
- $SharedProsperityUser = Db::name('shared_prosperity_user')->where('user_id', $user['uid'])->value('id');
|
|
897
|
|
- if ($SharedProsperityUser) $isSharedProsperity = true;
|
|
|
896
|
+ $SharedProsperityLevel = 0;
|
|
|
897
|
+ $SharedProsperityUserPv = 0;
|
|
|
898
|
+ $SharedProsperityTeamPv = 0;
|
|
|
899
|
+ $SharedProsperityGroupId = 0;
|
|
|
900
|
+ $SharedProsperityUser = Db::name('shared_prosperity_user')->where('user_id', $user['uid'])->field('id,partner_level,pv')->find();
|
|
|
901
|
+ if ($SharedProsperityUser) {
|
|
|
902
|
+ $isSharedProsperity = true;
|
|
|
903
|
+ $SharedProsperityLevel = $SharedProsperityUser['partner_level'];
|
|
|
904
|
+ $SharedProsperityUserPv = $SharedProsperityUser['pv'];
|
|
|
905
|
+
|
|
|
906
|
+ // 直推人数
|
|
|
907
|
+ /**@var $SharedProsperityUserRepository SharedProsperityUserRepository*/
|
|
|
908
|
+ $SharedProsperityUserRepository = app()->make(SharedProsperityUserRepository::class);
|
|
|
909
|
+ $SharedProsperityTeamPv = count($SharedProsperityUserRepository->getSharedProsperityUserEntityListByParentId($user['uid']));
|
|
|
910
|
+
|
|
|
911
|
+ // 团员身份
|
|
|
912
|
+ $groupId = Db::name('shared_prosperity_group_user')->where('user_id', $user['uid'])->value('group_id');
|
|
|
913
|
+ if ($groupId) $SharedProsperityGroupId = $groupId;
|
|
|
914
|
+ }
|
|
898
|
915
|
$data['isSharedProsperity'] = $isSharedProsperity;
|
|
899
|
|
-
|
|
|
916
|
+ $data['SharedProsperityLevel'] = $SharedProsperityLevel;
|
|
|
917
|
+ $data['SharedProsperityUserPv'] = $SharedProsperityUserPv;
|
|
|
918
|
+ $data['SharedProsperityTeamPv'] = $SharedProsperityTeamPv;
|
|
|
919
|
+ $data['SharedProsperityGroupId'] = $SharedProsperityGroupId;
|
|
|
920
|
+
|
|
|
921
|
+ // 查询会员体系团队pv
|
|
|
922
|
+ $memberTeamPvLog = false;
|
|
|
923
|
+ $sql = "select getUserLevelId({$user['uid']}) as uids";
|
|
|
924
|
+ try {
|
|
|
925
|
+ $spread_user_list = Db::query($sql);
|
|
|
926
|
+ } catch (\Exception $exception) {
|
|
|
927
|
+ return app('json')->fail($exception->getMessage());
|
|
|
928
|
+ }
|
|
|
929
|
+
|
|
|
930
|
+ $spread_user_list = explode(",", trim($spread_user_list[0]['uids'], '$,'));
|
|
|
931
|
+ $pvLog = Db::name('user_pv_log')
|
|
|
932
|
+ ->whereIn('uid',$spread_user_list)
|
|
|
933
|
+ ->limit(1)
|
|
|
934
|
+ ->select()
|
|
|
935
|
+ ->toArray();
|
|
|
936
|
+ if ($pvLog) $memberTeamPvLog = true;
|
|
|
937
|
+ $data['memberTeamPvLog'] = $memberTeamPvLog;
|
|
900
|
938
|
|
|
901
|
939
|
return app('json')->success($data );
|
|
902
|
940
|
}
|