<?php

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

class CreatePartnerWithdrawalsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('partner_withdrawals', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('partner_id')->comment('合伙人id');
            $table->decimal('amount')->nullable()->comment('申请提现金额');
            $table->string('bill_pic')->default('')->comment('发票图片');
            $table->tinyInteger('status')->comment('提现状态,0待审核,1已通过待打款,2已打款,3拒绝');
            $table->timestamp('completed_at')->nullable()->comment('提现完成时间');
            $table->string('reason')->default('')->comment('拒绝原因');
            $table->string('info')->comment('账户信息');
            $table->string('admin')->default('')->comment('系统操作人');
            $table->string('bill_no')->default('')->comment('发票代码');
            $table->string('pic')->default('')->comment('打款凭证');
            $table->timestamps();

            $table->comment('合伙人-提现申请表');
        });
    }

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