|
@@ -12,7 +12,7 @@ use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
|
|
class RechargeWithDraw
|
|
class RechargeWithDraw
|
|
|
{
|
|
{
|
|
|
- public function recharge($UserID, $Recharge)
|
|
|
|
|
|
|
+ public function recharge($UserID, $Recharge, $Fee = 0)
|
|
|
{
|
|
{
|
|
|
$Recharge = $Recharge * NumConfig::NUM_VALUE;
|
|
$Recharge = $Recharge * NumConfig::NUM_VALUE;
|
|
|
|
|
|
|
@@ -28,19 +28,25 @@ class RechargeWithDraw
|
|
|
DB::connection('mysql')->table('rummy_ltv_statistics')
|
|
DB::connection('mysql')->table('rummy_ltv_statistics')
|
|
|
->where('channel', $UserRegisterDate->Channel)
|
|
->where('channel', $UserRegisterDate->Channel)
|
|
|
->where('at_date', Carbon::parse($UserRegisterDate->RegisterDate)->format('Ymd'))
|
|
->where('at_date', Carbon::parse($UserRegisterDate->RegisterDate)->format('Ymd'))
|
|
|
- ->increment('total_recharge', $Recharge);
|
|
|
|
|
|
|
+ ->update([
|
|
|
|
|
+ 'total_recharge' => DB::raw('total_recharge+' . $Recharge),
|
|
|
|
|
+ 'total_recharge_fee' => DB::raw('total_recharge_fee+' . $Fee),
|
|
|
|
|
+ ]);
|
|
|
|
|
|
|
|
DB::connection('mysql')->table('rummy_ltv_statistics')
|
|
DB::connection('mysql')->table('rummy_ltv_statistics')
|
|
|
->where('channel', -1)
|
|
->where('channel', -1)
|
|
|
->where('at_date', Carbon::parse($UserRegisterDate->RegisterDate)->format('Ymd'))
|
|
->where('at_date', Carbon::parse($UserRegisterDate->RegisterDate)->format('Ymd'))
|
|
|
- ->increment('total_recharge', $Recharge);
|
|
|
|
|
|
|
+ ->update([
|
|
|
|
|
+ 'total_recharge' => DB::raw('total_recharge+' . $Recharge),
|
|
|
|
|
+ 'total_recharge_fee' => DB::raw('total_recharge_fee+' . $Fee),
|
|
|
|
|
+ ]);
|
|
|
} catch (\Exception $exception) {
|
|
} catch (\Exception $exception) {
|
|
|
Log::info('【充值】数据统计后台信息添加失败' . $UserID . ' - ' . $Recharge);
|
|
Log::info('【充值】数据统计后台信息添加失败' . $UserID . ' - ' . $Recharge);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function withDraw($UserID, $WithDraw)
|
|
|
|
|
|
|
+ public function withDraw($UserID, $WithDraw, $Fee = 0)
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
|
|
|
|
@@ -54,14 +60,48 @@ class RechargeWithDraw
|
|
|
DB::connection('mysql')->table('rummy_cash_statistics')
|
|
DB::connection('mysql')->table('rummy_cash_statistics')
|
|
|
->where('channel', $UserRegisterDate->Channel)
|
|
->where('channel', $UserRegisterDate->Channel)
|
|
|
->where('at_date', Carbon::parse($UserRegisterDate->RegisterDate)->format('Ymd'))
|
|
->where('at_date', Carbon::parse($UserRegisterDate->RegisterDate)->format('Ymd'))
|
|
|
- ->increment('total_cash', $WithDraw);
|
|
|
|
|
|
|
+ ->update([
|
|
|
|
|
+ 'total_cash' => DB::raw('total_cash+' . $WithDraw),
|
|
|
|
|
+ 'total_cash_fee' => DB::raw('total_cash_fee+' . $Fee),
|
|
|
|
|
+ ]);
|
|
|
|
|
|
|
|
DB::connection('mysql')->table('rummy_cash_statistics')
|
|
DB::connection('mysql')->table('rummy_cash_statistics')
|
|
|
->where('channel', -1)
|
|
->where('channel', -1)
|
|
|
->where('at_date', Carbon::parse($UserRegisterDate->RegisterDate)->format('Ymd'))
|
|
->where('at_date', Carbon::parse($UserRegisterDate->RegisterDate)->format('Ymd'))
|
|
|
- ->increment('total_cash', $WithDraw);
|
|
|
|
|
|
|
+ ->update([
|
|
|
|
|
+ 'total_cash' => DB::raw('total_cash+' . $WithDraw),
|
|
|
|
|
+ 'total_cash_fee' => DB::raw('total_cash_fee+' . $Fee),
|
|
|
|
|
+ ]);
|
|
|
} catch (\Exception $exception) {
|
|
} catch (\Exception $exception) {
|
|
|
Log::info('【提现】数据统计后台信息添加失败' . $UserID . ' - ' . $WithDraw);
|
|
Log::info('【提现】数据统计后台信息添加失败' . $UserID . ' - ' . $WithDraw);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public function refund($UserID, $Recharge, $Fee)
|
|
|
|
|
+ {
|
|
|
|
|
+ $Recharge = $Recharge * NumConfig::NUM_VALUE;
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ // 数据统计后台 -- 退款记录添加
|
|
|
|
|
+ $UserRegisterDate = DB::table(TableName::QPAccountsDB() . 'AccountsInfo')->where('UserID', $UserID)->select('RegisterDate', 'Channel')->first();
|
|
|
|
|
+
|
|
|
|
|
+ DB::connection('mysql')->table('rummy_ltv_statistics')
|
|
|
|
|
+ ->where('channel', $UserRegisterDate->Channel)
|
|
|
|
|
+ ->where('at_date', Carbon::parse($UserRegisterDate->RegisterDate)->format('Ymd'))
|
|
|
|
|
+ ->update([
|
|
|
|
|
+ 'total_refund' => DB::raw('total_refund+' . $Recharge),
|
|
|
|
|
+ 'total_refund_fee' => DB::raw('total_refund_fee+' . $Fee),
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ DB::connection('mysql')->table('rummy_ltv_statistics')
|
|
|
|
|
+ ->where('channel', -1)
|
|
|
|
|
+ ->where('at_date', Carbon::parse($UserRegisterDate->RegisterDate)->format('Ymd'))
|
|
|
|
|
+ ->update([
|
|
|
|
|
+ 'total_refund' => DB::raw('total_refund+' . $Recharge),
|
|
|
|
|
+ 'total_refund_fee' => DB::raw('total_refund_fee+' . $Fee),
|
|
|
|
|
+ ]);
|
|
|
|
|
+ } catch (\Exception $exception) {
|
|
|
|
|
+ Log::info('【充值】数据统计后台退款信息添加失败' . $UserID . ' - ' . $Fee);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|