Commit 90d56336 authored by 冯超鹏's avatar 冯超鹏

tcp 协议模块

parent 059a029c
Pipeline #203 canceled with stages
...@@ -40,7 +40,7 @@ class ZehongTcpController extends Controller ...@@ -40,7 +40,7 @@ class ZehongTcpController extends Controller
return $totcp; return $totcp;
} }
$totcpdata = $totcp['devicenum'] . $totcp['shutoff_status'] . $devicechongqi . $devicezijian; $totcpdata = $totcp['devicenum'] . $totcp['device_control'] . $devicechongqi . $devicezijian;
$crcdata = $this->getPrc($totcpdata); $crcdata = $this->getPrc($totcpdata);
return $totcpdata .$crcdata ; return $totcpdata .$crcdata ;
} }
...@@ -87,10 +87,10 @@ class ZehongTcpController extends Controller ...@@ -87,10 +87,10 @@ class ZehongTcpController extends Controller
if($data != []){ if($data != []){
$datainfo = DB::table('device') $datainfo = DB::table('device')
->where('devicenum','=',$data['id']) ->where('devicenum','=',$data['id'])
->update(['nd'=>intval($data['np']),'shutoff_status'=>$data['famen'],'devicepolice'=>$data['status'] == 0 ? '1' : $data['status'],'update_time'=>time()]); ->update(['nd'=>intval($data['np']),'devicepolice'=>$data['status'] == 0 ? '1' : $data['status'],'update_time'=>time()]);
$todata = DB::table('device') $todata = DB::table('device')
->where('devicenum','=',$data['id']) ->where('devicenum','=',$data['id'])
->select('devicenum','nd','shutoff_status','devicepolice') ->select('devicenum','nd','device_control','devicepolice')
->first(); ->first();
if ($todata){ if ($todata){
return json_encode($todata); return json_encode($todata);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment