This commit is contained in:
chenbo 2024-01-31 10:18:59 +08:00
parent ec5d57c69b
commit a0d5104838
1 changed files with 5 additions and 0 deletions

View File

@ -38,6 +38,11 @@ class AnimalInfoLogic extends BaseLogic
*/ */
public static function add(array $params): bool public static function add(array $params): bool
{ {
$repeat = AnimalInfo::where('sn', $params['sn'])->count();
if ($repeat > 0) {
self::setError('耳号已使用');
return false;
}
Db::startTrans(); Db::startTrans();
try { try {
AnimalInfo::create([ AnimalInfo::create([