2024_10_01_025556_create_member_benefit_table.php 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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. * Run the migrations.
  8. */
  9. public function up(): void
  10. {
  11. Schema::create('member_benefit', function (Blueprint $table) {
  12. $table->id();
  13. $table->bigInteger('user_id')->comment('用户ID');
  14. $table->bigInteger('order_id')->nullable()->comment('订单ID');
  15. $table->bigInteger('withdraw_id')->nullable()->comment('提现ID');
  16. $table->tinyInteger('type')->nullable()->comment('订单类型 1-支付 2-退款 3-扣除 4-提现 5-返还 6-收益 8-赠送 9-交通费');
  17. $table->text('remark')->nullable()->comment('备注');
  18. $table->integer('benefit')->default(0)->comment('收益');
  19. $table->integer('balance')->default(0)->comment('余额');
  20. $table->timestamps();
  21. });
  22. }
  23. /**
  24. * Reverse the migrations.
  25. */
  26. public function down(): void
  27. {
  28. Schema::dropIfExists('member_benefit');
  29. }
  30. };