Files
tcpserver-flow/app/repository/EndoscopeRepository.php
T
2026-03-08 22:58:56 +08:00

39 lines
895 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace app\repository;
use app\model\EctMetaEndoscope;
/**
* 内镜数据仓库
* 封装 ect_meta_endoscope 表的查询操作
*/
class EndoscopeRepository extends BaseRepository
{
public function __construct()
{
$this->model = new EctMetaEndoscope();
}
public static function new(): static
{
return new self();
}
/**
* 通过 RFID 卡号查询内镜信息
* 同时匹配主卡号(endoscope_rfid)和备用卡号(rfid3
*
* @param string $cardNo RFID 卡号(大写)
* @return EctMetaEndoscope|null
*/
public function findByCardNo(string $cardNo): ?EctMetaEndoscope
{
$cardNo = strtoupper($cardNo);
/** @var EctMetaEndoscope|null */
return EctMetaEndoscope::where('endoscope_rfid', $cardNo)
->orWhere('rfid3', $cardNo)
->first();
}
}