Snowflake.php 548 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: zhengmingwei
  5. * Date: 2020/1/6
  6. * Time: 9:45 下午
  7. */
  8. namespace addons\unishop\extend;
  9. class Snowflake extends \Godruoyi\Snowflake\Snowflake
  10. {
  11. /**
  12. * Snowflake constructor.
  13. * @param int $datacenter 数据中心id
  14. * @param int $workerid 机器id
  15. * @throws \Exception
  16. */
  17. public function __construct(int $datacenter = 1, int $workerid = 1)
  18. {
  19. parent::__construct($datacenter, $workerid);
  20. self::setStartTimeStamp(strtotime('2020-01-01')*1000);
  21. }
  22. }