From c50366f67000083576407f07d010f44552fb3839 Mon Sep 17 00:00:00 2001 From: huang <1724659546@qq.com> Date: Fri, 3 Oct 2025 22:17:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=B9=89model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/infra/models/pig.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/infra/models/pig.go b/internal/infra/models/pig.go index 037b507..8042528 100644 --- a/internal/infra/models/pig.go +++ b/internal/infra/models/pig.go @@ -45,6 +45,11 @@ func (PigBatch) TableName() string { return "pig_batches" } +// IsActive 判断猪批次是否处于活跃状态 +func (pb PigBatch) IsActive() bool { + return pb.Status != BatchStatusSold && pb.Status != BatchStatusArchived +} + // LogChangeType 定义了猪批次数量变更的类型 type LogChangeType string