url . 'api/v1/HuanYaSeven/open', [ 'device_sn' => $device_id, 'text' => $text ]); // 记录日志 $uid = defined('UID') ? UID : ''; platformLog([ 'device_sn' => $device_id, 'text' => $text ], $result, 'huanya_command_uid_' . $uid); return $result; } /** * 环亚设备返回(二维码 刷卡 人脸识别) * @param $data 人脸传过来的值 * @param bool $open * @param string $msg * @return \think\response\Json */ function huanYaDeviceReturn($data, $open = true, $msg = '欢迎') { $result = [ 'reply' => 'ACK', 'cmd' => 'face', 'code' => 0, 'sequence_no' => $data['sequence_no'], 'cap_time' => $data['cap_time'], 'gateway_ctrl' => $open ? [ 'device_type' => 'gpio', 'device_no' => 1, 'long_card_id' => '', 'ctrl_mode' => 'force', 'person_id' => $data['match']['person_id'] ?? '', ] : [], 'tts' => [ 'text' => $msg, ], // 'text_display'=>[ // 'position'=>['x'=>0,'y'=>300], // 'alive_time'=>1500, // 'text'=>$msg, // 'font_size'=>40, // 'font_spacing'=>1, // 'font_color'=>'0x00000000' // ], ]; // 记录日志 $uid = defined('UID') ? UID : ''; platformLog($data, $result, 'huanya_device_return_uid_' . $uid); return json($result); } }