商户订单
This commit is contained in:
@@ -79,6 +79,29 @@ return new class extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
// 订单支付日志(支付成功后写入,关联三方支付流水)
|
||||
if (! Schema::hasTable('order_payments')) {
|
||||
Schema::create('order_payments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('payment_no', 32)->comment('支付日志编号');
|
||||
$table->unsignedBigInteger('order_id')->comment('订单ID');
|
||||
$table->unsignedInteger('user_id')->comment('支付用户ID');
|
||||
$table->unsignedBigInteger('payment_transaction_id')->nullable()->comment('三方支付流水ID');
|
||||
$table->decimal('amount', 10, 2)->comment('支付金额');
|
||||
$table->tinyInteger('pay_type')->comment('支付方式:0=余额,1=微信支付');
|
||||
$table->tinyInteger('status')->default(0)->comment('状态:0=待支付,1=已支付,2=已退款');
|
||||
$table->timestamp('paid_at')->nullable()->comment('支付时间');
|
||||
$table->timestamp('refund_at')->nullable()->comment('退款时间');
|
||||
$table->timestamps();
|
||||
$table->unique('payment_no');
|
||||
$table->index('order_id');
|
||||
$table->index('user_id');
|
||||
$table->index('payment_transaction_id');
|
||||
$table->index('status');
|
||||
$table->comment('订单支付日志');
|
||||
});
|
||||
}
|
||||
|
||||
// 商户提现
|
||||
if (! Schema::hasTable('merchant_withdrawals')) {
|
||||
Schema::create('merchant_withdrawals', function (Blueprint $table) {
|
||||
@@ -103,6 +126,7 @@ return new class extends Migration
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('merchant_withdrawals');
|
||||
Schema::dropIfExists('order_payments');
|
||||
Schema::dropIfExists('order_refunds');
|
||||
Schema::dropIfExists('order_items');
|
||||
Schema::dropIfExists('orders');
|
||||
|
||||
@@ -454,6 +454,31 @@ class SysRuleSeeder extends Seeder
|
||||
['type' => 'rule', 'name' => '删除任务', 'key' => 'merchant.print-task.delete'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'route',
|
||||
'name' => '订单管理',
|
||||
'key' => 'merchant.order',
|
||||
'path' => '/merchant/order',
|
||||
'local' => 'menu.merchant.order',
|
||||
'children' => [
|
||||
['type' => 'rule', 'name' => '查询列表', 'key' => 'merchant.order.query'],
|
||||
['type' => 'rule', 'name' => '新增订单', 'key' => 'merchant.order.create'],
|
||||
['type' => 'rule', 'name' => '修改订单', 'key' => 'merchant.order.update'],
|
||||
['type' => 'rule', 'name' => '删除订单', 'key' => 'merchant.order.delete'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'route',
|
||||
'name' => '订单退款',
|
||||
'key' => 'merchant.refund',
|
||||
'path' => '/merchant/refund',
|
||||
'local' => 'menu.merchant.refund',
|
||||
'children' => [
|
||||
['type' => 'rule', 'name' => '查询列表', 'key' => 'merchant.refund.query'],
|
||||
['type' => 'rule', 'name' => '处理退款', 'key' => 'merchant.refund.update'],
|
||||
['type' => 'rule', 'name' => '删除记录', 'key' => 'merchant.refund.delete'],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
// 校园任务
|
||||
@@ -625,6 +650,29 @@ class SysRuleSeeder extends Seeder
|
||||
['type' => 'rule', 'key' => 'finance.transaction.delete', 'name' => '删除'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'route',
|
||||
'name' => '订单支付日志',
|
||||
'key' => 'merchant.order_payment',
|
||||
'path' => '/finance/order-payment',
|
||||
'local' => 'menu.finance.order_payment',
|
||||
'children' => [
|
||||
['type' => 'rule', 'name' => '查询', 'key' => 'merchant.order_payment.query'],
|
||||
['type' => 'rule', 'name' => '删除', 'key' => 'merchant.order_payment.delete'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'route',
|
||||
'name' => '商户提现',
|
||||
'key' => 'merchant.withdrawal',
|
||||
'path' => '/finance/merchant-withdrawal',
|
||||
'local' => 'menu.finance.merchant_withdrawal',
|
||||
'children' => [
|
||||
['type' => 'rule', 'name' => '查询', 'key' => 'merchant.withdrawal.query'],
|
||||
['type' => 'rule', 'name' => '审核', 'key' => 'merchant.withdrawal.update'],
|
||||
['type' => 'rule', 'name' => '删除', 'key' => 'merchant.withdrawal.delete'],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user