在线支付

This commit is contained in:
liu
2026-08-27 21:17:02 +08:00
parent 65eb8ef594
commit c35dac0055
15 changed files with 1381 additions and 10 deletions
@@ -42,6 +42,7 @@ return new class extends Migration
$table->string('phone', 20)->default('')->comment('联系电话');
$table->string('address', 255)->default('')->comment('门店地址');
$table->integer('payment_cycle_days')->default(0)->comment('回款周期(天)');
$table->string('openid', 64)->default('')->comment('微信小程序 openid(在线支付付款人标识,wx.login 换取后绑定)');
$table->decimal('total_purchase_amount', 12, 2)->default(0)->comment('总采购金额(只统计商品金额,账单支付后累加)');
$table->integer('status')->default(1)->comment('状态(1正常 0停用)');
$table->string('remark', 255)->nullable()->default('')->comment('备注');
@@ -15,19 +15,26 @@ return new class extends Migration
if (! Schema::hasTable('payment')) {
Schema::create('payment', function (Blueprint $table) {
$table->increments('id')->comment('支付记录ID');
$table->string('payment_no', 32)->unique()->comment('支付单号');
$table->string('payment_no', 32)->unique()->comment('支付单号(在线支付时作为商户订单号 mer_order_id 上送网关)');
$table->integer('store_id')->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->integer('pay_type')->default(1)->comment('支付类型(1线下凭证支付 2旺铺在线支付');
$table->integer('pay_method')->comment('支付方式(1微信 2支付宝 3对公汇款 4旺铺在线支付');
$table->string('voucher_ids', 255)->default('')->comment('汇款凭证图片ID(逗号分隔,线下凭证支付');
$table->integer('status')->default(0)->comment('状态(0待审核/待支付 1已通过/支付成功 2已拒绝/支付失败)');
$table->string('order_id', 64)->default('')->comment('旺铺平台订单号(网关返回)');
$table->string('trade_no', 64)->default('')->comment('通道交易流水号(支付成功返回)');
$table->string('openid', 64)->default('')->comment('付款人微信 openid(小程序在线支付)');
$table->timestamp('paid_at')->nullable()->comment('支付成功时间(网关交易时间)');
$table->text('pay_params')->nullable()->comment('旺铺下单返回的调起支付参数(JSON 快照)');
$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('支付记录表(小程序合并付款,后台审核汇款凭证)');
$table->index(['pay_type', 'status'], 'payment_type_status_index');
$table->comment('支付记录表(小程序合并付款:线下凭证后台审核 / 旺铺在线支付回调结账)');
});
}
}