GenCommerCountTjSeeder.php 634 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. use app\store\model\user\CommerCountTj;
  3. use think\migration\Seeder;
  4. class GenCommerCountTjSeeder extends Seeder
  5. {
  6. /**
  7. * Run Method.
  8. *
  9. * Write your database seeder using this method.
  10. *
  11. * More information on writing seeders is available here:
  12. * http://docs.phinx.org/en/latest/seeding.html
  13. */
  14. public function run()
  15. {
  16. $now = time();
  17. $csvTj = new CommerCountTj();
  18. for($i = 0;$i<=60;$i++){
  19. $baseTime = $now - 86400*$i;
  20. $csvTj->day($baseTime);
  21. $csvTj->week($baseTime);
  22. $csvTj->month($baseTime);
  23. }
  24. }
  25. }