<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('agent_income', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->nullable()->comment('分享人id')->index();
            $table->decimal('income',10,2)->default(0)->comment('收益金额');
            $table->tinyInteger('type')->default(0)->comment('收益类型 0:服务收益 1:介绍人收益 ');
            $table->tinyInteger('status')->default(0)->comment('审核状态 0:未审核 1:通过 2:拒绝');
            $table->tinyInteger('check_status')->default(0)->comment('复核状态 0:未审核 1:通过 2:拒绝');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('agent_income');
    }
};
