|
@@ -412,7 +412,6 @@ class Lampcontrol extends Base_Controller {
|
|
|
$token = $this->input->post('token',true);
|
|
|
$type = intval($this->input->post('type',true));
|
|
|
$lamp_id = $this->input->post('lamp_id',true);
|
|
|
- $clientid = $this->input->post('clientid',true);
|
|
|
$version = $this->session->userdata('version');
|
|
|
|
|
|
|
|
@@ -422,42 +421,12 @@ class Lampcontrol extends Base_Controller {
|
|
|
}
|
|
|
$ids = explode(',', $lamp_id);
|
|
|
$status = 1;
|
|
|
- // foreach ($ids as $v) {
|
|
|
- // $record['cmdtype'] = 0;
|
|
|
- // $record['relateid'] = $v;
|
|
|
- // $record['statuscmd'] = 0;
|
|
|
- // $record['updatetime'] = date("Y-m-d H:i:s");
|
|
|
- // $recordid = $this->Batmanage_model->get_record_id($record, 'batch_update_cmd');
|
|
|
- // if(!$recordid){
|
|
|
- // exit(json_result('0009', $this->response['0009'], array()));
|
|
|
- // }
|
|
|
- // if ($recordid != -1) {
|
|
|
- // $status = 0;
|
|
|
- // $cmd = '{"cmd_type":"batch_update_cmd","cmd_id":'.$recordid.'}';
|
|
|
- // $lampData = $this->Lamp_model->getOne($v,'N.status,N.protocoltype,L.protocoltype as lampprotocoltype');
|
|
|
- // if ($lampData['protocoltype'] == 4 || $lampData['protocoltype'] == 6) {
|
|
|
- // $url = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME'].'/api/device/lampcontrol/update_asy';
|
|
|
- // doAsyncRequest($url,['clientid'=>$clientid,'username'=>$username,'client_key'=>$client_key,'token'=>$token,'version'=>$version,'lamp_id'=>$v]);
|
|
|
- // continue;
|
|
|
- // }
|
|
|
- // if (isset($lampData['protocoltype']) && $lampData['protocoltype'] != 0) {
|
|
|
- // $cmdret = send_cmd($cmd,1,0,$lampData['protocoltype']);
|
|
|
- // if ($cmdret === false) {
|
|
|
- // sleep(1);
|
|
|
- // $cmdret = send_cmd($cmd,1,0,$lampData['protocoltype']);
|
|
|
- // }
|
|
|
- // }else{
|
|
|
- // $cmdret = send_cmd($cmd,0,0,$lampData['protocoltype']);
|
|
|
- // if ($cmdret === false) {
|
|
|
- // sleep(1);
|
|
|
- // $cmdret = send_cmd($cmd,0,0,$lampData['protocoltype']);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if($cmdret === false){
|
|
|
- // exit(json_result('0008', $this->response['0008'], array()));
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
+ $list = $this->Lamp_model->get_list(['id'=>$ids],'address');
|
|
|
+ foreach ($list as $v) {
|
|
|
+
|
|
|
+ send_cmd('18',$v['address'],'','0000000000','0100',0);
|
|
|
+
|
|
|
+ }
|
|
|
sleep(2);
|
|
|
if ($status) {
|
|
|
exit(json_result('0406', $this->response['0406'], array()));
|