20230402070552_create_new_statistics_table.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateNewStatisticsTable extends Migrator
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  13. *
  14. * The following commands can be used in this method and Phinx will
  15. * automatically reverse them when rolling back:
  16. *
  17. * createTable
  18. * renameTable
  19. * addColumn
  20. * renameColumn
  21. * addIndex
  22. * addForeignKey
  23. *
  24. * Remember to call "create()" or "update()" and NOT "save()" when working
  25. * with the Table class.
  26. */
  27. public function change()
  28. {
  29. $table = $this->table('data_statistics')->setComment('manage应用首页统计记录表');
  30. $table->addColumn('root_id', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '店面id'])
  31. ->addColumn('emp_count', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '员工数量'])
  32. ->addColumn('emp_manage_count', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '员工管理员数量'])
  33. ->addColumn('org_count', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '部门数量'])
  34. ->addColumn('motion_count', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '运营数量'])
  35. ->addColumn('manage_count', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '运营管理员数量'])
  36. ->addColumn('root_date', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '店面开通日期'])
  37. ->addColumn('case_count', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '案例数量'])
  38. ->addColumn('course_count', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '课程数量'])
  39. ->addColumn('building_count', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '楼盘数量'])
  40. ->addColumn('talkskill_count', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '话术数量'])
  41. ->addColumn('group_count', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> 'Vr作品数量'])
  42. ->addColumn('use_count', 'integer', ['limit'=> 11, 'default'=> 0, 'comment'=> '存储空间已经使用量'])
  43. ->create();
  44. $table = $this->table('permission');
  45. $table->addColumn('manage_logo', 'string', ['limit' => 255, 'comment'=> 'manage应用logo','default'=>''])
  46. ->update();
  47. }
  48. }