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