Step 4 - MarriageConfigService: - 带60min Cache 的配置读取/写入 - 支持单项/分组/全量读取,管理员保存后自动清缓存 Step 5 - MarriageIntimacyService: - 亲密度增加 + 日志写入 + 等级自动更新 - Redis 每日上限计数器(各来源独立控制) - onFlowerSent/onPrivateChat/onlineTick 接入点方法 - dailyBatch 批量处理(Horizon Job 用) Step 6 - MarriageService(核心业务): - propose/accept/reject/divorce/confirmDivorce/forceDissolve - 所有金币魅力通过 UserCurrencyService 统一记账 - 冷静期检查/超时处理/强制离婚金币全转对方 Models 改良(Marriage/MarriageConfig/MarriageIntimacyLog)
45 lines
856 B
PHP
45 lines
856 B
PHP
<?php
|
|
|
|
/**
|
|
* 文件功能:婚姻参数配置 Model
|
|
*
|
|
* 对应 marriage_configs 表,存储所有婚姻系统的可调参数。
|
|
* 管理员可在后台「婚姻管理 → 参数配置」页面修改,通过 MarriageConfigService 读取。
|
|
*
|
|
* @author ChatRoom Laravel
|
|
*
|
|
* @version 1.0.0
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class MarriageConfig extends Model
|
|
{
|
|
/** @var list<string> */
|
|
protected $fillable = [
|
|
'group',
|
|
'key',
|
|
'value',
|
|
'label',
|
|
'description',
|
|
'min',
|
|
'max',
|
|
];
|
|
|
|
/**
|
|
* 字段类型转换。
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'value' => 'integer',
|
|
'min' => 'integer',
|
|
'max' => 'integer',
|
|
];
|
|
}
|
|
}
|