订单支付记录
This commit is contained in:
@@ -30,6 +30,7 @@ return new class extends Migration
|
||||
$table->decimal('added_amount', 10, 2)->default(0)->comment('附加金额(周转筐/托盘金额)');
|
||||
$table->decimal('total_amount', 10, 2)->default(0)->comment('账单总金额 = 商品金额 + 配送费 + 附加金额');
|
||||
$table->integer('status')->default(0)->comment('支付状态(0未支付 1已支付)');
|
||||
$table->integer('payment_id')->default(0)->comment('关联支付记录ID(0=未发起支付)');
|
||||
$table->timestamp('paid_at')->nullable()->comment('付款时间(线下收款手动登记)');
|
||||
$table->string('pay_remark', 255)->default('')->comment('付款备注(线下收款信息)');
|
||||
$table->integer('paid_operator_id')->default(0)->comment('收款操作人(后台系统用户ID)');
|
||||
@@ -39,6 +40,7 @@ return new class extends Migration
|
||||
$table->unique(['purchase_id', 'store_id'], 'bill_purchase_store_unique');
|
||||
$table->index(['store_id', 'bill_date'], 'bill_store_date_index');
|
||||
$table->index(['status'], 'bill_status_index');
|
||||
$table->index(['payment_id'], 'bill_payment_index');
|
||||
$table->comment('门店账单表(采购单完成后按门店生成)');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?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');
|
||||
}
|
||||
};
|
||||
@@ -242,6 +242,16 @@ class PermissionSeeder extends Seeder
|
||||
['type' => 'rule', 'key' => 'recon.containerReturn.delete', 'name' => '删除'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'route',
|
||||
'key' => 'recon.payment',
|
||||
'name' => '支付记录',
|
||||
'path' => '/recon/payment',
|
||||
'children' => [
|
||||
['type' => 'rule', 'key' => 'recon.payment.query', 'name' => '查询'],
|
||||
['type' => 'rule', 'key' => 'recon.payment.audit', 'name' => '审核'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'route',
|
||||
'key' => 'recon.settlement',
|
||||
|
||||
@@ -17,7 +17,8 @@ class SysDataSeeder extends Seeder
|
||||
DB::table('sys_site_config_group')->insert([
|
||||
['id' => 1, 'title' => '网站设置', 'key' => 'web', 'remark' => '网站基础设置', 'created_at' => $date, 'updated_at' => $date],
|
||||
['id' => 2, 'title' => '小程序设置', 'key' => 'wechatMini', 'remark' => '小程序设置', 'created_at' => $date, 'updated_at' => $date],
|
||||
['id' => 3, 'title' => '支付配置', 'key' => 'pay', 'remark' => '网站的支付配置', 'created_at' => $date, 'updated_at' => $date],
|
||||
['id' => 3, 'title' => '业务配置', 'key' => 'services', 'remark' => '小程序设置', 'created_at' => $date, 'updated_at' => $date],
|
||||
['id' => 4, 'title' => '支付配置', 'key' => 'pay', 'remark' => '网站的支付配置', 'created_at' => $date, 'updated_at' => $date],
|
||||
]);
|
||||
DB::table('sys_site_config_items')->insert([
|
||||
['id' => 1, 'group_id' => 1, 'key' => 'title', 'title' => '网站标题', 'describe' => '网站标题,用于展示在网站logo旁边和登录页面以及网页title中', 'values' => 'Xin Admin', 'type' => 'Input','options' => "", 'sort' => 0, 'created_at' => $date, 'updated_at' => $date,],
|
||||
@@ -26,6 +27,11 @@ class SysDataSeeder extends Seeder
|
||||
['id' => 4, 'group_id' => 1, 'key' => 'describe', 'title' => '网站描述', 'describe' => '网站的基本描述', 'values' => '没有描述', 'type' => 'TextArea','options' => "", 'sort' => 2, 'created_at' => $date, 'updated_at' => $date],
|
||||
['id' => 5, 'group_id' => 2, 'key' => 'appid', 'title' => 'APPID', 'describe' => '小程序的APPID', 'values' => '没有描述', 'type' => 'Input','options' => "", 'sort' => 0, 'created_at' => $date, 'updated_at' => $date],
|
||||
['id' => 6, 'group_id' => 2, 'key' => 'secret', 'title' => 'SecretKey', 'describe' => '小程序的SecretKey', 'values' => '没有描述', 'type' => 'Input','options' => "", 'sort' => 1, 'created_at' => $date, 'updated_at' => $date],
|
||||
['id' => 7, 'group_id' => 3, 'key' => 'box_amount', 'title' => '周转筐金额', 'describe' => '周转筐的金额,用于附加业务金额的计算', 'values' => '', 'type' => 'InputNumber','props' => "min=0\nmax=10000\nstep=0.01", 'sort' => 0, 'created_at' => $date, 'updated_at' => $date],
|
||||
['id' => 8, 'group_id' => 3, 'key' => 'tray_amount', 'title' => '周转托盘金额', 'describe' => '周转托盘的金额,用于附加金额的计算', 'values' => '', 'type' => 'InputNumber','props' => "min=0\nmax=10000\nstep=0.01", 'sort' => 1, 'created_at' => $date, 'updated_at' => $date],
|
||||
['id' => 9, 'group_id' => 4, 'key' => 'wechat_qrcode', 'title' => '微信收款码', 'describe' => '微信收款码图片地址(在文件管理中上传收款码后复制图片链接,或直接填写文件ID),小程序付款页展示', 'values' => '', 'type' => 'Input','options' => "", 'sort' => 0, 'created_at' => $date, 'updated_at' => $date],
|
||||
['id' => 10, 'group_id' => 4, 'key' => 'alipay_qrcode', 'title' => '支付宝收款码', 'describe' => '支付宝收款码图片地址(在文件管理中上传收款码后复制图片链接,或直接填写文件ID),小程序付款页展示', 'values' => '', 'type' => 'Input','options' => "", 'sort' => 1, 'created_at' => $date, 'updated_at' => $date],
|
||||
['id' => 11, 'group_id' => 4, 'key' => 'bank_info', 'title' => '对公汇款信息', 'describe' => '对公账户汇款信息(户名、账号、开户行等),小程序付款页展示', 'values' => '', 'type' => 'TextArea','options' => "", 'sort' => 2, 'created_at' => $date, 'updated_at' => $date],
|
||||
]);
|
||||
// 字典类型初始数据
|
||||
DB::table('sys_dict')->insert([
|
||||
|
||||
Reference in New Issue
Block a user