public function devicesBatch() { $method = Flight::request()->query->_method; $pkg = new Pkg(); if ($method === 'DELETE') { $data = Flight::request()->data->getData(); $devices = array_map(function ($deviceId) { return compact('deviceId'); }, $data); $ret = $pkg->removeDevices($devices); } else { Flight::json(null, 400); } // 控制 Curl 请求错误 $this->handleCurlError($pkg); Flight::json($ret); }