|
|
@@ -722,29 +722,49 @@ class GlobalLogicController extends BaseLogicController
|
|
|
->where(['user_id' => $UserID, 'pay_status' => 9])
|
|
|
->sum('amount');
|
|
|
$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();
|
|
|
- }
|
|
|
- $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();
|
|
|
- }
|
|
|
+ $samePhoneUids = [];
|
|
|
+ if ($userInfo->phone) {
|
|
|
+ $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();
|
|
|
+ }
|
|
|
|
|
|
- $uids = array_unique(array_merge($samePhoneUids, $sameEmailUids));
|
|
|
- $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');
|
|
|
- }
|
|
|
+ $uids = array_unique(array_merge($samePhoneUids, $sameEmailUids));
|
|
|
+ $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');
|
|
|
+ }
|
|
|
+ $samePhoneUids = [];
|
|
|
+ if ($userInfo->phone) {
|
|
|
+ $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();
|
|
|
+ }
|
|
|
+
|
|
|
+ $uids = array_unique(array_merge($samePhoneUids, $sameEmailUids));
|
|
|
+ $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');
|