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

tcp 模块

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