Browse Source

id_find refund flag

laowu 1 day ago
parent
commit
9237c17199

+ 34 - 0
app/Http/logic/admin/GlobalLogicController.php

@@ -717,6 +717,40 @@ class GlobalLogicController extends BaseLogicController
                 $data['mobileBand'] = 'PC';
             }
         }
+        // 退款信息
+        $data['refund_flag'] = DB::table('agent.dbo.order')
+            ->where(['user_id' => $UserID, 'pay_status' => 9])
+            ->count() > 0;
+        $data['refund_total'] = 0;
+        if ($data['refund_flag']) {
+            $samePhoneUids = [];
+            if ($userInfo->phone) {
+                $samePhoneUids = DB::connection('read')->table('QPAccountsDB.dbo.AccountPhone')
+                    ->where('PhoneNum', $userInfo->phone)->pluck('UserID')->toArray();
+            }
+
+            $sameRegIpUids = DB::connection('read')->table('QPAccountsDB.dbo.AccountsInfo')
+                ->where('IsAndroid', 0)
+                ->where('RegisterIP', $userInfo->RegisterIP)
+                ->pluck('UserID')->toArray();
+            $ips = DB::connection('read')->table('QPRecordDB.dbo.RecordUserLogonStatistics')
+                ->where('UserID', $user->UserID ?? 0)
+                ->distinct()
+                ->pluck('LogonIP');
+
+            $sameLoginIpUids = DB::connection('read')->table('QPRecordDB.dbo.RecordUserLogonStatistics')
+                ->whereIn('LogonIP', $ips)
+                ->selectRaw('UserID')
+                ->pluck('UserID')->toArray();
+            $uids = array_unique(array_merge($samePhoneUids, $sameRegIpUids, $sameLoginIpUids));
+            $uids[] = $UserID;
+            if (count($uids) > 0) {
+                $data['refund_total'] = DB::table('agent.dbo.order')->lock('WITH(NOLOCK)')
+                    ->whereIn('user_id', $uids)
+                    ->where('pay_status', 9)
+                    ->sum('amount');
+            }
+        }
 
         return compact('data', 'userInfo', 'registerInviteSwitches', 'gameCount', 'userSource', 'OpenPage','platformData');
     }

+ 1 - 1
resources/views/admin/global/id_list.blade.php

@@ -78,7 +78,7 @@
                             </tr>
                             <tr>
                                 <td>{{ __('auto.会员') }}ID</td>
-                                <td>{{$userInfo->GameID}}</td>
+                                <td>{{$userInfo->GameID}} @if($data['refund_flag']) <b style="color:red;">退款({{round($data['refund_total']/100, 2)}})</b> @endif</td>
                             </tr>
 
                             <tr>