Commit bd897ea1 authored by 冯超鹏's avatar 冯超鹏

no message

parent 4c0a472a
Pipeline #132 failed with stages
......@@ -473,16 +473,18 @@ class DevicesController extends Controller
$where = [];
if ($request->has('uid')) {
$user_id = $request->get('uid');
$where['uid'] = $user_id;
$where['device.uid'] = $user_id;
}
$data = DB::table('device')
->select('id', 'uid', 'nd', 'deviceinfo', 'devicenum', 'devicecoord', 'devicepolice', 'deviceremark', 'devicelinkman')
->join('status as s','device.devicepolice','=','s.id')
->select('device.id', 'device.uid', 'device.nd', 'device.deviceinfo', 'device.devicenum', 'device.devicecoord', 'device.devicepolice', 'device.deviceremark', 'device.devicelinkman','s.status_name')
->where($where)
->get();
} else {
$data = DB::table('device')
->select('id', 'uid', 'nd', 'deviceinfo', 'devicenum', 'devicecoord', 'devicepolice', 'deviceremark', 'devicelinkman')
->where('uid','=',Auth::id())
->join('status as s','device.devicepolice','=','s.id')
->select('device.id', 'device.uid', 'device.nd', 'device.deviceinfo', 'device.devicenum', 'device.devicecoord', 'device.devicepolice', 'device.deviceremark', 'device.devicelinkman','s.status_name')
->where('device.uid','=',Auth::id())
->get();
}
......
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