false, "error" => "非法请求"), JSON_UNESCAPED_UNICODE)); } else if (isset($_GET["keyword"]) and !empty($_GET["keyword"])) { $query_result = new QueryGarbage(); try { DbUtil::query("select * from garbage where name like ?", $query_result, array("%" . $_GET["keyword"] . "%")); json_res(json_encode(array("status" => true, "result" => $query_result->getGarbageObjArray(), "keyword" => $_GET["keyword"]), JSON_UNESCAPED_UNICODE)); } catch (Exception $e) { json_res(json_encode(array("status" => false, "error" => "系统出现严重异常,请联系管理员"), JSON_UNESCAPED_UNICODE)); } } else if (isset($_GET["category"]) and is_numeric($_GET["category"])) { $query_result = new QueryGarbage(); try { DbUtil::query("select * from garbage where category = ?", $query_result, array((int)$_GET["category"])); json_res(json_encode(array("status" => true, "result" => $query_result->getGarbageObjArray(), "category" => $_GET["category"]), JSON_UNESCAPED_UNICODE)); } catch (Exception $e) { json_res(json_encode(array("status" => false, "error" => "系统出现严重异常,请联系管理员"), JSON_UNESCAPED_UNICODE)); } } else { json_res(json_encode(array("status" => false, "error" => "非法查询参数"), JSON_UNESCAPED_UNICODE)); }