|
@@ -66,11 +66,12 @@ class GlobalUser extends BaseApiLogic
|
|
|
$StatusValue = DB::connection('read')->table('QPAccountsDB.dbo.SystemStatusInfo')
|
|
$StatusValue = DB::connection('read')->table('QPAccountsDB.dbo.SystemStatusInfo')
|
|
|
->where('StatusName', 'WithDrawPoint')
|
|
->where('StatusName', 'WithDrawPoint')
|
|
|
->select('StatusValue')
|
|
->select('StatusValue')
|
|
|
|
|
+ ->lock('with(nolock)')
|
|
|
->first()->StatusValue ?? 0;
|
|
->first()->StatusValue ?? 0;
|
|
|
$adminChannels=session('admin_channels');
|
|
$adminChannels=session('admin_channels');
|
|
|
$field = ['ai.GameID', 'ai.UserID', 'ai.SpreaderID', 'ai.NickName', 'ai.MemberOrder', 'ai.Nullity', 'ai.WebLogonTimes', 'ai.LastLogonIP', 'ai.LastLogonDate', 'ai.LastLogonMobile', 'ai.RegisterIP', 'ai.RegisterDate', 'ai.Channel', 'gi.Score', 'gi.InsureScore', 'gi.MaxScore', 'gi.MaxWinScore'];
|
|
$field = ['ai.GameID', 'ai.UserID', 'ai.SpreaderID', 'ai.NickName', 'ai.MemberOrder', 'ai.Nullity', 'ai.WebLogonTimes', 'ai.LastLogonIP', 'ai.LastLogonDate', 'ai.LastLogonMobile', 'ai.RegisterIP', 'ai.RegisterDate', 'ai.Channel', 'gi.Score', 'gi.InsureScore', 'gi.MaxScore', 'gi.MaxWinScore'];
|
|
|
- $Sql = DB::connection('read')->table(TableName::QPAccountsDB() . 'AccountsInfo as ai')
|
|
|
|
|
- ->leftJoin(TableName::QPTreasureDB() . 'GameScoreInfo as gi', 'ai.UserID', 'gi.UserID')
|
|
|
|
|
|
|
+ $Sql = DB::connection('read')->table(DB::raw(TableName::QPAccountsDB() . 'AccountsInfo as ai WITH (NOLOCK)'))
|
|
|
|
|
+ ->leftJoin(DB::raw(TableName::QPTreasureDB() . 'GameScoreInfo as gi WITH (NOLOCK)'), 'ai.UserID', 'gi.UserID')
|
|
|
->where('ai.IsAndroid', 0)
|
|
->where('ai.IsAndroid', 0)
|
|
|
->select($field);
|
|
->select($field);
|
|
|
if(count($adminChannels)<5)$Sql=$Sql->whereIn('ai.Channel', $adminChannels);
|
|
if(count($adminChannels)<5)$Sql=$Sql->whereIn('ai.Channel', $adminChannels);
|
|
@@ -352,12 +353,13 @@ class GlobalUser extends BaseApiLogic
|
|
|
$StatusValue = DB::connection('read')->table('QPAccountsDB.dbo.SystemStatusInfo')
|
|
$StatusValue = DB::connection('read')->table('QPAccountsDB.dbo.SystemStatusInfo')
|
|
|
->where('StatusName', 'WithDrawPoint')
|
|
->where('StatusName', 'WithDrawPoint')
|
|
|
->select('StatusValue')
|
|
->select('StatusValue')
|
|
|
|
|
+ ->lock('with(nolock)')
|
|
|
->first()->StatusValue ?? 0;
|
|
->first()->StatusValue ?? 0;
|
|
|
$where = [];
|
|
$where = [];
|
|
|
$field = ['ai.GameID', 'ai.UserID', 'ai.SpreaderID', 'ai.NickName', 'ai.MemberOrder', 'ai.Nullity', 'ai.WebLogonTimes', 'ai.LastLogonIP', 'ai.LastLogonDate', 'ai.RegisterIP', 'ai.RegisterDate', 'ai.Channel', 'gi.Score'];
|
|
$field = ['ai.GameID', 'ai.UserID', 'ai.SpreaderID', 'ai.NickName', 'ai.MemberOrder', 'ai.Nullity', 'ai.WebLogonTimes', 'ai.LastLogonIP', 'ai.LastLogonDate', 'ai.RegisterIP', 'ai.RegisterDate', 'ai.Channel', 'gi.Score'];
|
|
|
- $Sql = DB::connection('read')->table(TableName::QPAccountsDB() . 'AccountsInfo as ai')
|
|
|
|
|
|
|
+ $Sql = DB::connection('read')->table(DB::raw(TableName::QPAccountsDB() . 'AccountsInfo as ai WITH (NOLOCK)'))
|
|
|
->where('ai.IsAndroid', 0)
|
|
->where('ai.IsAndroid', 0)
|
|
|
- ->leftJoin(TableName::QPTreasureDB() . 'GameScoreInfo as gi', 'ai.UserID', 'gi.UserID')
|
|
|
|
|
|
|
+ ->leftJoin(DB::raw(TableName::QPTreasureDB() . 'GameScoreInfo as gi WITH (NOLOCK)'), 'ai.UserID', 'gi.UserID')
|
|
|
->select($field);
|
|
->select($field);
|
|
|
|
|
|
|
|
if (!empty($GameID))
|
|
if (!empty($GameID))
|
|
@@ -575,24 +577,20 @@ class GlobalUser extends BaseApiLogic
|
|
|
/**
|
|
/**
|
|
|
* 充值排行榜:总充值>100 且 提现/充值<35%
|
|
* 充值排行榜:总充值>100 且 提现/充值<35%
|
|
|
*/
|
|
*/
|
|
|
- public function rechargeRankList($channel)
|
|
|
|
|
|
|
+ public function rechargeRankList($channel, $sortRegister = '', $sortLogin = '')
|
|
|
{
|
|
{
|
|
|
$AccountsInfoM = new AccountsInfo();
|
|
$AccountsInfoM = new AccountsInfo();
|
|
|
$minRecharge = 100;
|
|
$minRecharge = 100;
|
|
|
|
|
|
|
|
- $field = [
|
|
|
|
|
- 'ai.GameID', 'ai.UserID', 'ai.NickName', 'ai.Channel',
|
|
|
|
|
- 'ai.RegisterDate', 'ai.LastLogonDate',
|
|
|
|
|
- 'gi.Score',
|
|
|
|
|
- 'rut.Recharge', 'rut.Withdraw',
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+ $numVal = NumConfig::NUM_VALUE;
|
|
|
|
|
+ $giTable = TableName::QPTreasureDB() . 'GameScoreInfo';
|
|
|
$Sql = DB::connection('read')->table(TableName::QPAccountsDB() . 'AccountsInfo as ai')
|
|
$Sql = DB::connection('read')->table(TableName::QPAccountsDB() . 'AccountsInfo as ai')
|
|
|
->join(TableName::QPRecordDB() . 'RecordUserTotalStatistics as rut', 'ai.UserID', 'rut.UserID')
|
|
->join(TableName::QPRecordDB() . 'RecordUserTotalStatistics as rut', 'ai.UserID', 'rut.UserID')
|
|
|
- ->leftJoin(TableName::QPTreasureDB() . 'GameScoreInfo as gi', 'ai.UserID', 'gi.UserID')
|
|
|
|
|
->where('ai.IsAndroid', 0)
|
|
->where('ai.IsAndroid', 0)
|
|
|
->where('rut.Recharge', '>', $minRecharge)
|
|
->where('rut.Recharge', '>', $minRecharge)
|
|
|
- ->whereRaw('rut.Withdraw * 1.0 / (rut.Recharge * ' . NumConfig::NUM_VALUE . ') < 0.35')
|
|
|
|
|
- ->select($field);
|
|
|
|
|
|
|
+ ->whereRaw("rut.Withdraw * 1.0 / (rut.Recharge * {$numVal}) < 0.35")
|
|
|
|
|
+ ->distinct()
|
|
|
|
|
+ ->selectRaw("ai.GameID, ai.UserID, ai.NickName, ai.Channel, ai.RegisterDate, ai.LastLogonDate, (select top 1 Score from {$giTable} where UserID = ai.UserID) as Score, rut.Recharge, rut.Withdraw");
|
|
|
|
|
|
|
|
if (!empty($channel) || $channel === '0') {
|
|
if (!empty($channel) || $channel === '0') {
|
|
|
$Sql->where('ai.Channel', $channel);
|
|
$Sql->where('ai.Channel', $channel);
|
|
@@ -603,7 +601,15 @@ class GlobalUser extends BaseApiLogic
|
|
|
$Sql->whereIn('ai.Channel', $adminChannels);
|
|
$Sql->whereIn('ai.Channel', $adminChannels);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $list = $Sql->orderByRaw('rut.Recharge desc')->paginate(15);
|
|
|
|
|
|
|
+ if (!empty($sortRegister) && in_array($sortRegister, ['asc', 'desc'])) {
|
|
|
|
|
+ $Sql->orderBy('ai.RegisterDate', $sortRegister);
|
|
|
|
|
+ } elseif (!empty($sortLogin) && in_array($sortLogin, ['asc', 'desc'])) {
|
|
|
|
|
+ $Sql->orderBy('ai.LastLogonDate', $sortLogin);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $Sql->orderByRaw('rut.Recharge desc');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $list = $Sql->paginate(15);
|
|
|
|
|
|
|
|
$UserIDs = [];
|
|
$UserIDs = [];
|
|
|
foreach ($list as $value) {
|
|
foreach ($list as $value) {
|