Commit 0c6beacb authored by 冯超鹏's avatar 冯超鹏

tcp 模块

parent 90d56336
Pipeline #204 canceled with stages
...@@ -23,7 +23,8 @@ class AlarmOrderController extends Controller ...@@ -23,7 +23,8 @@ class AlarmOrderController extends Controller
$limit = 20; $limit = 20;
$offset = $limit * ($request->input('page') - 1); $offset = $limit * ($request->input('page') - 1);
if($request->input('isuser') == 'user'){ if($request->input('isuser') == 'user'){
$isuser = ['u.id','=',Auth::id()]; $where = [];
$where[] = ['u.id','=',Auth::id()];
} }
$orders = AlarmOrder::selectRaw(' $orders = AlarmOrder::selectRaw('
FROM_UNIXTIME(r.starttime) AS start_time, FROM_UNIXTIME(r.starttime) AS start_time,
...@@ -39,7 +40,7 @@ class AlarmOrderController extends Controller ...@@ -39,7 +40,7 @@ class AlarmOrderController extends Controller
->leftjoin('users AS u', 'alarm_order.user_id', '=', 'u.id') ->leftjoin('users AS u', 'alarm_order.user_id', '=', 'u.id')
->leftjoin('status AS s', 's.id', '=', 'alarm_order.reportpolice_id') ->leftjoin('status AS s', 's.id', '=', 'alarm_order.reportpolice_id')
->offset($offset) ->offset($offset)
->where($isuser) ->where($where)
->limit($limit) ->limit($limit)
->get()->toArray(); ->get()->toArray();
return $this->jsonSuccessData($orders); return $this->jsonSuccessData($orders);
......
...@@ -39,7 +39,6 @@ class ZehongTcpController extends Controller ...@@ -39,7 +39,6 @@ class ZehongTcpController extends Controller
if ($totcp == "暂无设备"){ if ($totcp == "暂无设备"){
return $totcp; return $totcp;
} }
$totcpdata = $totcp['devicenum'] . $totcp['device_control'] . $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,7 +86,7 @@ class ZehongTcpController extends Controller ...@@ -87,7 +86,7 @@ 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']),'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(),'shutoff_status'=>$data['famen']]);
$todata = DB::table('device') $todata = DB::table('device')
->where('devicenum','=',$data['id']) ->where('devicenum','=',$data['id'])
->select('devicenum','nd','device_control','devicepolice') ->select('devicenum','nd','device_control','devicepolice')
......
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