|
|
@@ -36,7 +36,7 @@ class ProviderWithdrawalService
|
|
|
ProviderWithdrawalStatusEnum::TRANSFERRED,
|
|
|
])
|
|
|
->sum('gross_amount');
|
|
|
-
|
|
|
+
|
|
|
return max(0, $earnings - $withdrawn);
|
|
|
}
|
|
|
|
|
|
@@ -209,9 +209,12 @@ class ProviderWithdrawalService
|
|
|
{
|
|
|
return $query
|
|
|
->where('code_verified', true)
|
|
|
- ->whereRaw(
|
|
|
- $this->scheduleEndedAtExpression().' <= ?',
|
|
|
- [$this->withdrawalReleaseCutoff()]
|
|
|
+ ->when(
|
|
|
+ ! app()->environment('local', 'development'),
|
|
|
+ fn ($query) => $query->whereRaw(
|
|
|
+ $this->scheduleEndedAtExpression() . ' <= ?',
|
|
|
+ [$this->withdrawalReleaseCutoff()]
|
|
|
+ )
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -239,8 +242,6 @@ class ProviderWithdrawalService
|
|
|
|
|
|
private function withdrawalReleaseCutoff(): string
|
|
|
{
|
|
|
- return app()->environment('local', 'development')
|
|
|
- ? Carbon::now()->format('Y-m-d H:i:s')
|
|
|
- : Carbon::now()->subDays(5)->format('Y-m-d H:i:s');
|
|
|
+ return Carbon::now()->subDays(5)->format('Y-m-d H:i:s');
|
|
|
}
|
|
|
}
|