## 实际改动 - 为快递附加费报价规则和附加费类型记录新增、更改、启用、停用日志。 - 日志按公司隔离,记录操作人、时间、对象及安全字段的变更前后值,页面展示最近 50 条。 - 报价/类型写入与日志记录使用同一事务;审计表未迁移时保留只读查看并阻止无日志写入。 ## 修改范围 - 新增审计日志 Repository、Model 和迁移。 - 修改报价/类型 Repository、页面控制器、现有 VIP 黑金页面和对应 Feature 测试。 - 不修改路由、权限、菜单、上游数据源或生产配置。 ## 协作检查 - 已获取最新 `main` 并检查远程任务分支。 - `origin/feature/limeng-shipping-data-filters` 同样修改 `Pages.php`,但其逻辑为独立的发货数据页面,与本任务方法、路由、Repository、表和视图无实际重叠。 ## 验证 - `CourierSurchargePageTest`:9 个测试通过。 - `CourierPayableSummaryPagesTest`:14 个测试通过。 - 合计 23 个测试、336 个断言通过。 - 已验证现有报价可见、未迁移警告及写入禁用状态。 ## 风险与授权 - 新增 1 张审计日志表,需要随生产发布执行迁移。 - 用户已明确要求主线部署,授权本次迁移与发布。 - 未提交 `.env`、密码、Token、私钥、真实财务数据、生产日志或构建产物。 - 回滚代码时保留审计表及历史记录,不执行破坏性删表。 ## 合并前自审 - 已逐文件审核完整 diff,确认无越界修改、重复实现、敏感内容和未处理冲突。 - 使用 Squash merge 合并到最新 `main`,再按标准脚本部署。 Reviewed-on: http://git.1080p.hk/WuYongJie/CaiWuXiTong/pulls/227
45 lines
910 B
PHP
45 lines
910 B
PHP
<?php
|
|
|
|
namespace App\Models\Business;
|
|
|
|
use App\Abstracts\Model;
|
|
|
|
class CourierSurchargeAuditLog extends Model
|
|
{
|
|
public const ACTION_CREATED = 'created';
|
|
|
|
public const ACTION_UPDATED = 'updated';
|
|
|
|
public const ACTION_ACTIVATED = 'activated';
|
|
|
|
public const ACTION_DEACTIVATED = 'deactivated';
|
|
|
|
public const TARGET_QUOTE = 'quote';
|
|
|
|
public const TARGET_TYPE = 'type';
|
|
|
|
protected $table = 'business_courier_surcharge_audit_logs';
|
|
|
|
protected $fillable = [
|
|
'company_id',
|
|
'actor_id',
|
|
'action',
|
|
'target_type',
|
|
'target_id',
|
|
'target_label',
|
|
'changes',
|
|
];
|
|
|
|
protected $casts = [
|
|
'company_id' => 'integer',
|
|
'actor_id' => 'integer',
|
|
'target_id' => 'integer',
|
|
'changes' => 'array',
|
|
];
|
|
|
|
public function actor()
|
|
{
|
|
return $this->belongsTo(user_model_class(), 'actor_id');
|
|
}
|
|
}
|