getvalue('shouhuan_zone'); //时区 $upload_interval = $m_s->getvalue('shouhuan_local_space'); //定位间隔 $fd_is_open = $m_s->getvalue('shouhuan_fall_call'); //定位间隔 $pedo_is_open = $m_s->getvalue('shouhuan_step_status'); //计步开关 $remove_is_open = $m_s->getvalue('shouhuan_wear_call'); //佩戴开关 $param = [ 'zone' => $zone, 'upload_interval' => $upload_interval, 'fd_is_open' => $fd_is_open, 'lowbat_is_open' => 1, 'pedo_is_open' => $pedo_is_open, 'remove_is_open' => $remove_is_open, ]; $s_sc->facilityinit($facility_id, $device_id_code, $param, $sys_user_id); return backarr(1, "操作成功"); } /** * 低电报警开关 * * @param [type] $arr * @return void * @author wj * @date 2023-08-29 */ public function createlowbatcommand($facility_id, $device_id_code, $param, $sys_user_id) { if (!isset($param['is_open'])) { throw new \Exception("参数错误"); } $is_open = empty($param['is_open']) ? 0 : 1; $s_sc = new ShouhuanCommand(); $s_sc->createlowbatcommand($facility_id, $device_id_code, $is_open, $sys_user_id); return backarr(1, "操作成功"); } /** * 设置 跌倒报警开关 * * @param [type] $arr * @return void * @author wj * @date 2023-08-29 */ public function createfalldowncommand($facility_id, $device_id_code, $param, $sys_user_id) { if (!isset($param['is_open'])) { throw new \Exception("参数错误"); } $is_open = empty($param['is_open']) ? 0 : 1; $s_sc = new ShouhuanCommand(); $s_sc->createfalldowncommand($facility_id, $device_id_code, $is_open, $sys_user_id); return backarr(1, "操作成功"); } //['starttime'=>'21:00','endtime'=>'6:00']; /** * 设置睡眠/翻滚时间段 * * @param [type] $arr * @return void * @author wj * @date 2023-08-29 * 参数格式 ['starttime'=>'21:00','endtime'=>'6:00']; */ public function createsleeptimecommand($facility_id, $device_id_code, $data, $sys_user_id) { $param = ['starttime' => $data['starttime'], 'endtime' => $data['endtime']]; $s_sc = new ShouhuanCommand(); $s_sc->createsleeptimecommand($facility_id, $device_id_code, $param, $sys_user_id); return backarr(1, "操作成功"); } //立即定位 public function createcrcommand($facility_id, $device_id_code, $sys_user_id) { $s_sc = new ShouhuanCommand(); $s_sc->createcrcommand($facility_id, $device_id_code, $sys_user_id); return backarr(1, "操作成功"); } //设置sos 电话 /** * 设置sos 电话 * tels 一维数组 未验证是否为手机号 * @param [type] $arr * @return void * @author wj * @date 2023-08-29 */ public function createsoscommand($facility_id, $device_id_code, $data, $sys_user_id) { if (!isset($param['tels'])) { throw new \Exception("参数错误"); } $param = $data['tels']; $s_sc = new ShouhuanCommand(); $s_sc->createsoscommand($facility_id, $device_id_code, $param, $sys_user_id); return backarr(1, "操作成功"); } //设置电话本 /** * 设置电话本 * 参数格式 * $phldata = [ * ['telno' => '12344', 'name' => '测试2'], * ['telno' => '123', 'name' => '测试'], * ]; * @param [type] $arr * @return void * @author wj * @date 2023-08-29 */ public function createphlcommand($facility_id, $device_id_code, $data, $sys_user_id) { $param = $data; $s_sc = new ShouhuanCommand(); $s_sc->createphlcommand($facility_id, $device_id_code, $param, $sys_user_id); return backarr(1, "操作成功"); } /** * 数据间隔设置 * * @param [type] $facility_id * @param [type] $device_id_code * @param [type] $data * @param [type] $sys_user_id * @return void * @author wj * @date 2023-09-05 */ public function ctreateintervalcommand($facility_id, $device_id_code, $data, $sys_user_id) { $m_s = new SettingModel(); $s_sc = new ShouhuanCommand(); $usedata = []; //定位 if (!isset($data['cr_interval']) || empty($data['cr_interval'])) { $cr_interval = $m_s->getvalue('shouhuan_local_space'); //分钟 } else { $cr_interval = $data['cr_interval']; } $usedata['cr_interval'] = bcmul((int) $cr_interval, 60); //心率 if (!isset($data['hrt_interval']) || empty($data['hrt_interval'])) { $hrt_interval = $m_s->getvalue('shouhuan_heart_space'); //分钟 } else { $hrt_interval = $data['hrt_interval']; } $usedata['hrt_interval'] = bcmul((int) $hrt_interval, 60); //体温 if (!isset($data['wd_interval']) || empty($data['wd_interval'])) { $wd_interval = $m_s->getvalue('shouhuan_body_space'); //分钟 } else { $wd_interval = $data['wd_interval']; } $usedata['wd_interval'] = bcmul((int) $wd_interval, 60); //血压 if (!isset($data['bld_interval']) || empty($data['bld_interval'])) { $bld_interval = $m_s->getvalue('shouhuan_blood_space'); //分钟 } else { $bld_interval = $data['bld_interval']; } $usedata['bld_interval'] = bcmul((int) $bld_interval, 60); //血氧 if (!isset($data['ox_interval']) || empty($data['ox_interval'])) { $ox_interval = $m_s->getvalue('shouhuan_oxygen_space'); //分钟 } else { $ox_interval = $data['ox_interval']; } $usedata['ox_interval'] = bcmul((int) $ox_interval, 60); $s_sc->setdatainterval($facility_id, $device_id_code, $usedata, $sys_user_id); return backarr(1, "操作成功"); } /** * 关机 * * @param [type] $facility_id * @param [type] $device_id_code * @param [type] $sys_user_id * @return void * @author wj * @date 2023-09-05 */ public function createpoweroffcommand($facility_id, $device_id_code, $sys_user_id) { $s_sc = new ShouhuanCommand(); $s_sc->createpoweroffcommand($facility_id, $device_id_code, $sys_user_id); return backarr(1, "操作成功"); } /** * 静默时间 * * @param [type] $facility_id * @param [type] $device_id_code * @param [type] $param * @param [type] $sys_user_id * @return void * @author wj * @date 2023-09-05 */ public function createsilencetime2command($facility_id, $device_id_code, $param, $sys_user_id) { $s_sc = new ShouhuanCommand(); $s_sc->createsilencetime2command($facility_id, $device_id_code, $param, $sys_user_id); return backarr(1, "操作成功"); } /** * 开关机时间 * * @return void * @author wj * @date 2023-09-05 */ public function createbootoffcommand($facility_id, $device_id_code, $param, $sys_user_id) { $s_sc = new ShouhuanCommand(); $s_sc->createbootoffcommand($facility_id, $device_id_code, $param, $sys_user_id); return backarr(1, "操作成功"); } /** * 佩戴提醒 * * @param [type] $facility_id * @param [type] $device_id_code * @param [type] $param * @param [type] $sys_user_id * @return void * @author wj * @date 2023-09-05 */ public function createremovecommand($facility_id, $device_id_code, $param, $sys_user_id) { if (!isset($param['is_open'])) { throw new \Exception("参数错误"); } $is_open = empty($param['is_open']) ? 0 : 1; $s_sc = new ShouhuanCommand(); $s_sc->createremovecommand($facility_id, $device_id_code, $is_open, $sys_user_id); return backarr(1, "操作成功"); } /** * 闹钟 * * @param [type] $facility_id * @param [type] $device_id_code * @param [type] $param * @param [type] $sys_user_id * @return void * @author wj * @date 2023-09-05 */ public function createremindcommand($facility_id, $device_id_code, $param, $sys_user_id) { $s_sc = new ShouhuanCommand(); $s_sc->createremindcommand($facility_id, $device_id_code, $param, $sys_user_id); return backarr(1, "操作成功"); } /** * 计步开关 * * @return void * @author wj * @date 2023-09-05 */ public function createpedocommand($facility_id, $device_id_code, $param, $sys_user_id) { if (!isset($param['is_open'])) { throw new \Exception("参数错误"); } $is_open = empty($param['is_open']) ? 0 : 1; $s_sc = new ShouhuanCommand(); $s_sc->createpedocommand($facility_id, $device_id_code, $is_open, $sys_user_id); return backarr(1, "操作成功"); } }