This commit is contained in:
xl
2023-05-26 09:37:56 +08:00
parent d7fd23800b
commit 1f986439b2
+13 -8
View File
@@ -36,12 +36,17 @@ use function Swoole\Coroutine\run;
// //
//}); //});
function order(int $userId): string $spl = new \SplPriorityQueue();
{ $spl->insert(1,0);
$explode = current(explode(' ', str_replace('0.', '', round((float)microtime(),6)))); $spl->insert(2,0);
$spl->insert(3,0);
$spl->insert(4,0);
$spl->insert(5,0);
$spl->insert(6,0);
$spl->insert(7,0);
return 'N'.sprintf('%09d', $userId) . '.' . date('YmdHis') . '.' . str_pad($explode,6,0);
} $spl->compare();
var_dump( $spl->extract();
order(1)
); var_dump($spl);