|
@@ -505,7 +505,7 @@ class ShouhuanCommand
|
|
|
* @author wj
|
|
|
* @date 2023-08-21
|
|
|
*/
|
|
|
- public function getPHLCommaninfo($param)
|
|
|
+ public function getPHLCommandinfo($param)
|
|
|
{
|
|
|
if (50 < count($param)) {
|
|
|
throw new \Exception("PHL参数错误");
|
|
@@ -548,11 +548,14 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function getREMINDCommandinfo($param)
|
|
|
{
|
|
|
- if (3 > count($param)) {
|
|
|
- throw new \Exception("PHL参数错误");
|
|
|
+ if (empty($param)) {
|
|
|
+ throw new \Exception("REMINDC参数错误");
|
|
|
}
|
|
|
$usedata = [];
|
|
|
foreach ($param as $key => $value) {
|
|
|
+ if (3 > count($value)) {
|
|
|
+ throw new \Exception("REMINDC参数错误");
|
|
|
+ }
|
|
|
$useweeks = ["0", "0", "0", "0", "0", "0", "0"];
|
|
|
$time = $this->formattime($value['time'], 'H:i');
|
|
|
$isopen = $value['isopen'];
|
|
@@ -595,11 +598,14 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function getSILENCETIME2Commandinfo($param)
|
|
|
{
|
|
|
- if (3 <= count($param)) {
|
|
|
+ if (empty($param)) {
|
|
|
throw new \Exception("SILENCETIME2参数错误");
|
|
|
}
|
|
|
$usedata = [];
|
|
|
foreach ($param as $key => $value) {
|
|
|
+ if (4 > count($value)) {
|
|
|
+ throw new \Exception("SILENCETIME2参数错误");
|
|
|
+ }
|
|
|
$useweeks = ["0", "0", "0", "0", "0", "0", "0"];
|
|
|
//未比较时间大小
|
|
|
$starttime = $this->formattime($value['starttime'], 'H:i');
|
|
@@ -683,7 +689,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createsleeptimecommand($facility_id, $device_id_code, $param, $sys_user_id)
|
|
|
{
|
|
|
- $command = ['command' => 'SLEEPTIME'];
|
|
|
+ $command = ['command' => 'SLEEPTIME', 'content_arr' => ['command' => 'SLEEPTIME']];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, $param, $sys_user_id);
|
|
|
}
|
|
|
/**
|
|
@@ -695,7 +701,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createcrcommand($facility_id, $device_id_code, $sys_user_id)
|
|
|
{
|
|
|
- $command = ['command' => 'CR'];
|
|
|
+ $command = ['command' => 'CR', 'content_arr' => ['command' => 'CR']];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, [], $sys_user_id);
|
|
|
}
|
|
|
/**
|
|
@@ -710,7 +716,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createsoscommand($facility_id, $device_id_code, $param, $sys_user_id)
|
|
|
{
|
|
|
- $command = ['command' => 'SOS'];
|
|
|
+ $command = ['command' => 'SOS', 'content_arr' => ['command' => 'SOS']];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, $param, $sys_user_id);
|
|
|
}
|
|
|
/**
|
|
@@ -723,7 +729,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createphlcommand($facility_id, $device_id_code, $param, $sys_user_id)
|
|
|
{
|
|
|
- $command = ['command' => 'PHL'];
|
|
|
+ $command = ['command' => 'PHL', 'content_arr' => ['command' => 'PHL']];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, $param, $sys_user_id);
|
|
|
}
|
|
|
//设备初始化
|
|
@@ -788,7 +794,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createpoweroffcommand($facility_id, $device_id_code, $sys_user_id)
|
|
|
{
|
|
|
- $command = ['command' => 'POWEROFF'];
|
|
|
+ $command = ['command' => 'POWEROFF', 'content_arr' => ['command' => 'POWEROFF']];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, [], $sys_user_id);
|
|
|
}
|
|
|
/**
|
|
@@ -819,7 +825,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createremindcommand($facility_id, $device_id_code, $param, $sys_user_id)
|
|
|
{
|
|
|
- $command = ['command' => 'REMIND'];
|
|
|
+ $command = ['command' => 'REMIND', 'content_arr' => ['command' => 'REMIND']];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, $param, $sys_user_id);
|
|
|
}
|
|
|
/**
|
|
@@ -835,7 +841,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createsilencetime2command($facility_id, $device_id_code, $param, $sys_user_id)
|
|
|
{
|
|
|
- $command = ['command' => 'SILENCETIME2'];
|
|
|
+ $command = ['command' => 'SILENCETIME2', 'content_arr' => ['command' => 'SILENCETIME2']];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, $param, $sys_user_id);
|
|
|
}
|
|
|
/**
|
|
@@ -856,7 +862,7 @@ class ShouhuanCommand
|
|
|
$shutdown_time = $param['shutdown_time'];
|
|
|
$command = [
|
|
|
'command' => 'BOOTOFF',
|
|
|
- 'content' => ['command' => 'BOOTOFF', 'is_open' => $is_open, 'bootup_time' => $bootup_time, 'shutdown_time' => $shutdown_time],
|
|
|
+ 'content_arr' => ['command' => 'BOOTOFF', 'is_open' => $is_open, 'bootup_time' => $bootup_time, 'shutdown_time' => $shutdown_time],
|
|
|
];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, [], $sys_user_id);
|
|
|
}
|