mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 11:27:24 +08:00
improve update
This commit is contained in:
@@ -43,25 +43,6 @@ class BonusRepository extends BaseRepository
|
||||
|
||||
}
|
||||
|
||||
public function initSeedPoints(): int
|
||||
{
|
||||
$size = 10000;
|
||||
$tableName = (new User())->getTable();
|
||||
$result = 0;
|
||||
do {
|
||||
$affectedRows = NexusDB::table($tableName)
|
||||
->whereNull('seed_points')
|
||||
->limit($size)
|
||||
->update([
|
||||
'seed_points' => NexusDB::raw('seed_points = seedbonus')
|
||||
]);
|
||||
$result += $affectedRows;
|
||||
do_log("affectedRows: $affectedRows, query: " . last_query());
|
||||
} while ($affectedRows > 0);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function consumeToBuyMedal($uid, $medalId): bool
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user