request->param('deviceId', ''); if (empty($deviceId)) { return errorJson('缺少必要参数'); } $user = Db::name('user')->alias('u') ->join('device_user du','u.id = du.userId and u.companyId = du.companyId') ->join('device d','du.deviceId = d.id and u.companyId = du.companyId') ->where(['d.deviceImei' => $deviceId,'u.deleteTime' => 0,'du.deleteTime' => 0,'d.deleteTime'=> 0 ]) ->find(); exit_data($user); } }