2024_09_06_061734_create_service_project_table.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. */
  10. public function up(): void
  11. {
  12. Schema::create('service_project', function (Blueprint $table) {
  13. $table->comment('服务项目表');
  14. $table->id();
  15. $table->string('title')->comment('标题');
  16. $table->string('sub_title')->comment('副标题');
  17. $table->string('cover')->nullable()->comment('封面图');
  18. $table->double('price')->default(0.00)->nullable()->comment('价格');
  19. $table->double('init_price')->default(0.00)->nullable()->comment('原价');
  20. $table->integer('sale')->default(0)->nullable()->comment('销量');
  21. $table->integer('true_sale')->default(0)->nullable()->comment('实际销量');
  22. $table->integer('total_sale')->default(0)->nullable()->comment('总销量');
  23. $table->integer('time_long')->default(0)->nullable()->comment('服务时长');
  24. $table->integer('max_time')->default(0)->nullable()->comment('最长预约');
  25. $table->text('introduce')->nullable()->comment('介绍');
  26. $table->text('explain')->nullable()->comment('说明');
  27. $table->text('notice')->nullable()->comment('须知');
  28. $table->string('sort')->default(0)->comment('分类排序');
  29. $table->tinyInteger('status')->default(0)->comment('账户状态 (0正常 1停用)');
  30. $table->tinyInteger('com_balance')->default(0)->comment('分佣比例');
  31. $table->tinyInteger('is_add')->default(0)->comment('是否加钟服务');
  32. $table->double('material_price')->default(0.00)->nullable()->comment('物料费');
  33. $table->tinyInteger('is_store')->default(0)->comment('是否支持到店');
  34. $table->tinyInteger('is_door')->default(1)->comment('是否支持上门');
  35. $table->timestamps();
  36. });
  37. }
  38. /**
  39. * Reverse the migrations.
  40. */
  41. public function down(): void
  42. {
  43. Schema::dropIfExists('service_project');
  44. }
  45. };