diff --git a/app/adminapi/logic/animal_info/AnimalInfoLogic.php b/app/adminapi/logic/animal_info/AnimalInfoLogic.php index d10b9c1..ffb3506 100644 --- a/app/adminapi/logic/animal_info/AnimalInfoLogic.php +++ b/app/adminapi/logic/animal_info/AnimalInfoLogic.php @@ -38,6 +38,11 @@ class AnimalInfoLogic extends BaseLogic */ public static function add(array $params): bool { + $repeat = AnimalInfo::where('sn', $params['sn'])->count(); + if ($repeat > 0) { + self::setError('耳号已使用'); + return false; + } Db::startTrans(); try { AnimalInfo::create([