This commit is contained in:
chenbo 2024-02-21 14:45:58 +08:00
parent 9f5bed1aa6
commit a65aecd7cf
1 changed files with 2 additions and 1 deletions

View File

@ -135,9 +135,10 @@ class AnimalInfoLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = AnimalInfo::with(['fenceHouseAttr'])->findOrEmpty($params['id'])->toArray();
if (isset($params['sn'])) {
$data = AnimalInfo::with(['fenceHouseAttr'])->where('sn', $params['sn'])->findOrEmpty()->toArray();
} else {
$data = AnimalInfo::with(['fenceHouseAttr'])->findOrEmpty($params['id'])->toArray();
}
// 查动物体温
$res = RemoteRequestLogic::requestAnimalTemperature($data['sn']);