2020_10_13_061605_docters.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class Docters extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::table('docters', function (Blueprint $table) {
  15. // 修改docters字段
  16. // $table->integer('user_id')->comment('用户表关联id');
  17. // $table->string('password',50)->nullable()->comment('密码');
  18. // $table->integer('is_then')->nullable()->comment('是否认证:0=未认证;1=认证');
  19. // $table->string('practice',200)->nullable()->comment('医生照片和执业证书,号分开');
  20. // $table->string('card_photo',200)->nullable()->comment('身份证正反面,号分开');
  21. // $table->string('is_quail',200)->nullable()->comment('照片和资格证书,号分开');
  22. // $table->integer('card_id',20)->nullable()->comment('身份证号');
  23. });
  24. // 创建意见详情
  25. /* Schema::create('suggests_detail', function (Blueprint $table) {
  26. $table->integer('suggest_id')->comment('suggest表主键');
  27. $table->string('supplement_reason',2000)->comment('补充原因');
  28. $table->string('supplement_content',2000)->comment('补充建议');
  29. $table->timestamps();
  30. });*/
  31. // 修改订单表
  32. Schema::table('orders', function (Blueprint $table) {
  33. //添加接单时间
  34. // $table->integer('receiving_time')->comment('接单时间');
  35. });
  36. // 用户消息表
  37. Schema::table('user_messages', function (Blueprint $table) {
  38. //添加医生id
  39. // $table->integer('docter_id')->after('user_id')->comment('医生ID');
  40. });
  41. // 医生消息表
  42. Schema::create('docter_messages', function (Blueprint $table) {
  43. // $table->bigIncrements('id');
  44. // $table->integer('user_id')->comment("用户ID");
  45. // $table->integer('docter_id')->comment("医生ID");
  46. // $table->tinyInteger('status')->comment("状态(1.未读 2.已读)");
  47. // $table->tinyInteger('type')->comment("类型(1.图文订单 2.电话订单 3.预约订单 4.评价通知 5.系统通知)");
  48. // $table->integer('relation_id')->comment("关联ID(发出消息操作关联的表的id,比如:医生结束消息时,就该关联意见单ID,因为用户点击消息会进入看意见单)");
  49. // $table->string('content',500)->comment("消息内容");
  50. // $table->timestamps();
  51. });
  52. // 童话记录表
  53. /* Schema::create('call_logs', function (Blueprint $table) {
  54. $table->bigIncrements('id');
  55. $table->integer('order_id')->nullable()->comment("订单表ID");
  56. $table->integer('dial_time')->nullable()->comment("拨打时间");
  57. $table->integer('dialend_time')->nullable()->comment("结束时间");
  58. $table->integer('talk_time')->nullable()->comment("通话时长");
  59. $table->timestamps();
  60. });*/
  61. // 医生时间段服务设置
  62. /* Schema::create('docter_times', function (Blueprint $table) {
  63. $table->bigIncrements('id');
  64. $table->integer('docter_id')->comment("医生id");
  65. $table->decimal('base_price',8,2)->nullable()->comment("基础价格");
  66. $table->decimal('step_price',8,2)->nullable()->comment("步进价格");
  67. $table->string('service_time',2000)->nullable()->comment("服务时间(00点到24点的索引)");
  68. $table->integer('person')->nullable()->comment("服务人次");
  69. $table->integer('type')->nullable()->comment("类型(1=电话咨询,2=图文咨询,3=门诊预约,4=疫苗接种预约,5=儿保预约,6=服务包,7=充值)");
  70. $table->integer('relation_id')->nullable()->comment("关联id(为门诊预约时,关联机构id)");
  71. $table->timestamps();
  72. });*/
  73. // user表添加字段
  74. Schema::table('users', function (Blueprint $table) {
  75. // $table->string('remark',200)->nullable()->comment('用户备注');
  76. });
  77. // 医生用户关联表,暂时没用到 (可以作为拓展用)
  78. Schema::create('docter_user', function (Blueprint $table) {
  79. // $table->bigIncrements('id');
  80. // $table->integer('docter_id')->comment('医生表主键');
  81. // $table->integer('user_id')->comment('用户表主键');
  82. // $table->timestamps();
  83. });
  84. //医生机构表加字段
  85. Schema::table('docter_organization', function (Blueprint $table) {
  86. //添加医生id
  87. // $table->integer('offices_id')->nullable()->after('organization_id')->comment('机构ID');
  88. // $table->integer('qualifications_id')->nullable()->after('offices_id')->comment('资质id');
  89. // $table->integer('state')->nullable()->after('qualifications_id')->comment('审核状态(0=待审核,1=审核通过,2=审核拒绝)');
  90. });
  91. // 排班具体时间表
  92. Schema::table('schedule_periods', function (Blueprint $table) {
  93. //添加医生id
  94. $table->integer('type')->nullable()->after('docter_id')->comment('下单时间段(1=早上,2=下午,3=晚上)');
  95. });
  96. // 意见
  97. Schema::table('suggests', function (Blueprint $table) {
  98. //添加医生id
  99. $table->integer('patient_id')->nullable()->after('user_id')->comment('患者id');
  100. });
  101. }
  102. /**
  103. * Reverse the migrations.
  104. *
  105. * @return void
  106. */
  107. public function down()
  108. {
  109. Schema::table('docters', function (Blueprint $table) {
  110. $table->dropColumn('user_id');
  111. $table->dropColumn('receiving_time');
  112. });
  113. Schema::dropIfExists('suggests_detail');
  114. Schema::table('orders', function (Blueprint $table) {
  115. //删除接单时间
  116. $table->dropColumn('receiving_time');
  117. });
  118. Schema::dropIfExists('docter_messages');
  119. // Schema::dropIfExists('call_logs');
  120. // Schema::dropIfExists('docter_times');
  121. Schema::table('user', function (Blueprint $table) {
  122. });
  123. Schema::table('user_messages', function (Blueprint $table) {
  124. //
  125. });
  126. Schema::table('docter_organization', function (Blueprint $table) {
  127. //
  128. });
  129. Schema::table('schedule_periods', function (Blueprint $table) {
  130. //
  131. });
  132. Schema::table('suggests', function (Blueprint $table) {
  133. //
  134. });
  135. Schema::dropIfExists('docter_user');
  136. }
  137. }