修复:离婚冷静期配置项被错误写入系统参数表而非婚姻参数配置表的问题
This commit is contained in:
@@ -1,40 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*/
|
|
||||||
public function up(): void
|
|
||||||
{
|
|
||||||
DB::table('sysparam')->insertOrIgnore([
|
|
||||||
[
|
|
||||||
'alias' => 'divorce_mutual_cooldown',
|
|
||||||
'guidetxt' => '协议离婚冷静期(天)',
|
|
||||||
'body' => '70'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'alias' => 'divorce_forced_cooldown',
|
|
||||||
'guidetxt' => '强制离婚冷静期(天)',
|
|
||||||
'body' => '70'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'alias' => 'divorce_auto_cooldown',
|
|
||||||
'guidetxt' => '系统强制离婚冷静期(天)',
|
|
||||||
'body' => '70'
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
DB::table('sysparam')->whereIn('alias', [
|
|
||||||
'divorce_mutual_cooldown',
|
|
||||||
'divorce_forced_cooldown',
|
|
||||||
'divorce_auto_cooldown'
|
|
||||||
])->delete();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
DB::table('marriage_configs')->insertOrIgnore([
|
||||||
|
[
|
||||||
|
'group' => '时间规则',
|
||||||
|
'key' => 'divorce_mutual_cooldown',
|
||||||
|
'value' => 70,
|
||||||
|
'label' => '协议离婚冷静期(天)',
|
||||||
|
'description' => '协议离婚成功后,多少天内不能再次结婚 (支持设置为 0)',
|
||||||
|
'min' => 0,
|
||||||
|
'max' => 365,
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'group' => '时间规则',
|
||||||
|
'key' => 'divorce_auto_cooldown',
|
||||||
|
'value' => 70,
|
||||||
|
'label' => '系统强制离婚冷静期(天)',
|
||||||
|
'description' => '单方面申请协议离婚但对方不管,导致超时后系统强制离婚的冷静期',
|
||||||
|
'min' => 0,
|
||||||
|
'max' => 365,
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
// 由于离婚有 mutual, auto, forced 等,我们同时添加 forced 参数的插入以防遗漏
|
||||||
|
DB::table('marriage_configs')->insertOrIgnore([
|
||||||
|
[
|
||||||
|
'group' => '时间规则',
|
||||||
|
'key' => 'divorce_forced_cooldown',
|
||||||
|
'value' => 70,
|
||||||
|
'label' => '单方强制离婚冷静期(天)',
|
||||||
|
'description' => '通过单方面强制解除契约功能导致的离婚冷静期',
|
||||||
|
'min' => 0,
|
||||||
|
'max' => 365,
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
DB::table('marriage_configs')->whereIn('key', [
|
||||||
|
'divorce_mutual_cooldown',
|
||||||
|
'divorce_auto_cooldown',
|
||||||
|
'divorce_forced_cooldown',
|
||||||
|
])->delete();
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user