2021_04_13_030601_create_orders_table.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateOrdersTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('orders', function (Blueprint $table) {
  15. $table->id();
  16. $table->string('order_no', 30)->comment('订单号');
  17. $table->bigInteger('user_id')->default(0)->comment('用户id');
  18. $table->bigInteger('device_id')->default(0)->comment('设备id');
  19. $table->bigInteger('shop_id')->default(0)->comment('站点id');
  20. $table->tinyInteger('work_type')->default(0)->comment('工作类型');
  21. $table->integer('work_time')->default(0)->comment('工作时间');
  22. $table->timestamp('start_use_time')->nullable()->comment('开始时间');
  23. $table->timestamp('end_use_time')->nullable()->comment('结束时间');
  24. $table->decimal('time_money', 7, 2)->default(0.00)->comment('时长费用');
  25. $table->decimal('preferential_money', 7, 2)->default(0.00)->comment('优惠金额');
  26. $table->string('preferential_type')->default("-0-")->comment('优惠类型');
  27. $table->decimal('total_money', 7, 2)->default(0.00)->comment('总价格');
  28. $table->tinyInteger('pay_status')->default(0)->comment('支付状态');
  29. $table->decimal('pay_money', 7, 2)->default(0.00)->comment('支付金额');
  30. $table->timestamp('pay_time')->nullable()->comment('支付时间');
  31. $table->tinyInteger('pay_type')->default(0)->comment('支付方式');
  32. $table->string('pay_result')->nullable()->comment('支付响应文件');
  33. $table->tinyInteger('status')->default(1);
  34. $table->timestamps();
  35. });
  36. }
  37. /**
  38. * Reverse the migrations.
  39. *
  40. * @return void
  41. */
  42. public function down()
  43. {
  44. Schema::dropIfExists('orders');
  45. }
  46. }