mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
fix claim settle cronjob
This commit is contained in:
@@ -32,8 +32,9 @@ class Kernel extends ConsoleKernel
|
|||||||
$schedule->command('hr:update_status')->everyMinute()->withoutOverlapping();
|
$schedule->command('hr:update_status')->everyMinute()->withoutOverlapping();
|
||||||
$schedule->command('hr:update_status --ignore_time=1')->hourly()->withoutOverlapping();
|
$schedule->command('hr:update_status --ignore_time=1')->hourly()->withoutOverlapping();
|
||||||
$schedule->command('user:delete_expired_token')->dailyAt('04:00');
|
$schedule->command('user:delete_expired_token')->dailyAt('04:00');
|
||||||
$schedule->command('claim:settle')->hourly()->between("00:00", "12:00")
|
$schedule->command('claim:settle')->hourly()->when(function () {
|
||||||
->when(function () {return Carbon::now()->format('d') == '01';})->withoutOverlapping();
|
return Carbon::now()->format('d') == '01';
|
||||||
|
})->withoutOverlapping();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use App\Models\Snatch;
|
|||||||
use App\Models\Torrent;
|
use App\Models\Torrent;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Nexus\Database\NexusDB;
|
use Nexus\Database\NexusDB;
|
||||||
|
|
||||||
@@ -106,7 +107,9 @@ class ClaimRepository extends BaseRepository
|
|||||||
$startOfThisMonth = Carbon::now()->startOfMonth();
|
$startOfThisMonth = Carbon::now()->startOfMonth();
|
||||||
$query = Claim::query()
|
$query = Claim::query()
|
||||||
->select(['uid'])
|
->select(['uid'])
|
||||||
->where('last_settle_at', '<', $startOfThisMonth)
|
->where(function (Builder $query) use ($startOfThisMonth) {
|
||||||
|
$query->where('last_settle_at', '<', $startOfThisMonth)->orWhereNull('last_settle_at');
|
||||||
|
})
|
||||||
->groupBy('uid')
|
->groupBy('uid')
|
||||||
;
|
;
|
||||||
$size = 10000;
|
$size = 10000;
|
||||||
|
|||||||
Reference in New Issue
Block a user