2022_01_12_072821_create_order_table.php
1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateOrderTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('order', function (Blueprint $table) {
$table->increments('id');
$table->string('order_sn')->index()->default('')->comment('订单号');
$table->unsignedBigInteger('user_id')->index()->comment('用户id');
$table->string('description')->default('')->comment('订单描述');
$table->string('thumbnail')->default('')->comment('缩略图');
$table->decimal('pay_amount')->comment('实付金额');
$table->decimal('goods_amount')->comment('商品金额');
$table->unsignedSmallInteger('status')->comment('订单状态:100待付款 101用户取消 102超时取消 103商户取消 201已付款 204已完成');
$table->timestamp('cancel_time')->nullable()->comment('关闭时间');
$table->string('source')->comment('来源');
$table->string('pay_number')->default('')->comment('支付交易号');
$table->string('pay_type')->default('')->comment('支付类型');
$table->string('callback')->default('')->comment('回调参数');
$table->timestamp('pay_time')->nullable()->comment('支付时间');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('order');
}
}