Files
xin-procurement/database/migrations/2026_08_14_000002_create_payment_table.php
T
2026-08-14 01:58:57 +08:00

44 lines
2.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
* 支付记录:小程序端选择门店账单合并付款,提交汇款凭证,后台审核通过后账单批量置已支付
*/
public function up(): void
{
if (! Schema::hasTable('payment')) {
Schema::create('payment', function (Blueprint $table) {
$table->increments('id')->comment('支付记录ID');
$table->string('payment_no', 32)->unique()->comment('支付单号');
$table->integer('store_id')->comment('门店ID');
$table->integer('user_id')->default(0)->comment('提交人(小程序用户ID');
$table->decimal('amount', 10, 2)->default(0)->comment('支付金额(= 关联账单总金额合计,提交时快照)');
$table->integer('pay_method')->comment('支付方式(1微信 2支付宝 3对公汇款)');
$table->string('voucher_ids', 255)->default('')->comment('汇款凭证图片ID(逗号分隔)');
$table->integer('status')->default(0)->comment('状态(0待审核 1已通过 2已拒绝)');
$table->string('remark', 255)->default('')->comment('门店备注');
$table->timestamp('audited_at')->nullable()->comment('审核时间');
$table->integer('auditor_id')->default(0)->comment('审核人(后台系统用户ID');
$table->string('audit_remark', 255)->default('')->comment('审核备注(拒绝原因)');
$table->timestamps();
$table->index(['store_id', 'status'], 'payment_store_status_index');
$table->comment('支付记录表(小程序合并付款,后台审核汇款凭证)');
});
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('payment');
}
};