mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 05:00:49 +08:00
fix getusertorrentlistajax hr
This commit is contained in:
@@ -40,7 +40,7 @@ class AttendanceCleanup extends Command
|
||||
{
|
||||
$query = Attendance::query()->groupBy('uid')->selectRaw('uid, max(id) as max_id');
|
||||
$page = 1;
|
||||
$size = 1000;
|
||||
$size = 10000;
|
||||
while (true) {
|
||||
$rows = $query->forPage($page, $size)->get();
|
||||
$log = "sql: " . last_query() . ", count: " . $rows->count();
|
||||
|
||||
49
app/Console/Commands/AttendanceMigrate.php
Normal file
49
app/Console/Commands/AttendanceMigrate.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Attendance;
|
||||
use App\Repositories\AttendanceRepository;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class AttendanceMigrate extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'attendance:migrate';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Migrate attendance from one time one record to one user one record.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
$rep = new AttendanceRepository();
|
||||
$result = $rep->migrateAttendance();
|
||||
$log = sprintf('[%s], %s, result: %s, query: %s', REQUEST_ID, __METHOD__, var_export($result, true), last_query());
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,9 @@ class Test extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
$rep = new AttendanceRepository();
|
||||
$r = $rep->migrateAttendance();
|
||||
dd($r);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user