Explorar el Código

feat(auth): 添加会员体系团队pv查询功能

- 删除了团员身份检查后的多余空行
- 添加了会员体系团队pv查询逻辑
- 实现了通过存储过程获取用户下级列表功能
- 集成了用户pv日志查询验证团队成员活跃状态
- 添加了异常处理确保数据库查询稳定性
- 将会员团队pv状态集成到认证响应数据中
shichen hace 5 meses
padre
commit
cf707bff9e
Se han modificado 1 ficheros con 17 adiciones y 1 borrados
  1. 17 1
      app/controller/api/Auth.php

+ 17 - 1
app/controller/api/Auth.php

@@ -911,7 +911,6 @@ class Auth extends BaseController
911 911
             // 团员身份
912 912
             $groupId = Db::name('shared_prosperity_group_user')->where('user_id', $user['uid'])->value('group_id');
913 913
             if ($groupId) $SharedProsperityGroupId = $groupId;
914
-
915 914
         }
916 915
         $data['isSharedProsperity'] = $isSharedProsperity;
917 916
         $data['SharedProsperityLevel'] = $SharedProsperityLevel;
@@ -919,6 +918,23 @@ class Auth extends BaseController
919 918
         $data['SharedProsperityTeamPv'] = $SharedProsperityTeamPv;
920 919
         $data['SharedProsperityGroupId'] = $SharedProsperityGroupId;
921 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;
922 938
 
923 939
         return app('json')->success($data );
924 940
     }