|
|
@@ -720,7 +720,7 @@ class GlobalLogicController extends BaseLogicController
|
|
|
// 退款信息
|
|
|
$data['refund_flag'] = DB::table('agent.dbo.order')
|
|
|
->where(['user_id' => $UserID, 'pay_status' => 9])
|
|
|
- ->count() > 0;
|
|
|
+ ->sum('amount');
|
|
|
$data['refund_total'] = 0;
|
|
|
if ($data['refund_flag']) {
|
|
|
$samePhoneUids = [];
|
|
|
@@ -728,21 +728,16 @@ class GlobalLogicController extends BaseLogicController
|
|
|
$samePhoneUids = DB::connection('read')->table('QPAccountsDB.dbo.AccountPhone')
|
|
|
->where('PhoneNum', $userInfo->phone)->pluck('UserID')->toArray();
|
|
|
}
|
|
|
+ $awi = DB::table('QPAccountsDB.dbo.AccountWithDrawInfo')
|
|
|
+ ->where(['UserID' => $UserID])
|
|
|
+ ->first();
|
|
|
+ $sameEmailUids = [];
|
|
|
+ if ($awi && $awi->EmailAddress) {
|
|
|
+ $sameEmailUids = DB::connection('read')->table('QPAccountsDB.dbo.AccountWithDrawInfo')
|
|
|
+ ->where('EmailAddress', $awi->EmailAddress)->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 = array_unique(array_merge($samePhoneUids, $sameEmailUids));
|
|
|
$uids[] = $UserID;
|
|
|
if (count($uids) > 0) {
|
|
|
$data['refund_total'] = DB::table('agent.dbo.order')->lock('WITH(NOLOCK)')
|