47 lines
1.9 KiB
PHP
47 lines
1.9 KiB
PHP
<?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('bills', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('mchid', 32)->index()->comment('商户ID');
|
|
$table->string('appid', 32)->nullable()->index()->comment('应用ID');
|
|
$table->string('billable_type', 100)->nullable()->index()->comment('多态模型名称');
|
|
$table->integer('billable_id')->nullable()->index()->comment('多态模型ID');
|
|
$table->integer('user_id')->nullable()->index()->comment('用户ID');
|
|
$table->string('openid', 30)->nullable()->index()->comment('Openid(微信支付涉及)');
|
|
$table->string('title', 150)->nullable()->comment('订单名称');
|
|
$table->tinyInteger('pay_way')->nullable()->index()->comment('支付方式');
|
|
$table->decimal('pay_amount', 12)->comment('支付发起金额');
|
|
$table->string('pay_no', 40)->unique()->comment('商户订单号');
|
|
$table->string('pay_service_no', 40)->nullable()->unique()->comment('支付商订单号');
|
|
$table->timestamp('pay_at')->nullable()->index()->comment('支付成功时间');
|
|
$table->tinyInteger('bill_status')->index()->comment('账单状态');
|
|
$table->tinyInteger('pay_status')->index()->comment('支付状态');
|
|
$table->string('extra', 150)->nullable()->comment('额外数据');
|
|
$table->string('remark')->nullable()->comment('备注');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('bills');
|
|
}
|
|
};
|