<?php

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

class CreateAlbumOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('album_order', function (Blueprint $table) {
            $table->increments('id');
            $table->string('sno',64)->comment('订单号');
            $table->string('qrcode',255)->comment('二维码');
            $table->tinyInteger('status')->comment('订单状态：0：待审核；1：待生产；2：生产中；3：生产完成，待发货；4：运输中，待收货；5：已签收，待评价');
            $table->string('category',255)->comment('产品分类');
            $table->string('type',255)->comment('产品型号');
            $table->string('color',255)->comment('产品颜色');
            $table->string('picture',255)->comment('产品图片');
            $table->text('question',255)->comment('问题描述');
            $table->string('customer_name',255)->comment('用户姓名');
            $table->string('customer_phone',11)->comment('联系方式');
            $table->string('customer_address',255)->comment('收货地址');

            $table->integer('user_id')->nullable()->comment('用户ID');

            $table->integer('verifier_id')->nullable()->comment('审核客服ID');
            $table->integer('producer_id')->nullable()->comment('生产部员ID');
            $table->integer('packer_id')->nullable()->comment('包装部员ID');

            $table->float('price')->nullable()->comment('费用');
            $table->date('expected_time')->nullable()->comment('预计完成时间');
            $table->string('remark')->nullable()->comment('客服备注');
            $table->integer('store_id')->comment('站点');

            $table->softDeletes();
            $table->timestamps();
        });
    }

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