Commit 5b001948 authored by 冯超鹏's avatar 冯超鹏

提交用户

parent 89135b93
Pipeline #97 canceled with stages
......@@ -379,10 +379,19 @@ class DevicesController extends Controller
//返回设备当前报警
public function police()
{
$data = DB::table('reportpolice as r')
->join('status as s', 'r.policestatus', '=', 's.id')
->select('r.*', 's.status_name')
->get();
if (!is_null($this->isadmin())) {
$data = DB::table('reportpolice as r')
->join('status as s', 'r.policestatus', '=', 's.id')
->select('r.*', 's.status_name')
->get();
}else{
$data = DB::table('reportpolice as r')
->join('status as s', 'r.policestatus', '=', 's.id')
->join('device as d' , 'r.devicenumber','=','d.devicenum')
->where('d.uid','=',Auth::id())
->select('r.*', 's.status_name')
->get();
}
return $this->jsonSuccessData($data);
}
......
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