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
{
$explode = current(explode(' ', str_replace('0.', '', round((float)microtime(),6))));
$spl = new \SplPriorityQueue();
$spl->insert(1,0);
$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);
}
var_dump(
order(1)
);
$spl->compare();
$spl->extract();
var_dump($spl);