$code = input_helper($_POST["code"]); } if ($_POST["max"] == '') { echo json_encode(array("code" => "1", "msg" => "max is null")); return; } else { $max = input_helper($_POST["max"]); } if ($_POST["min"] == '') { echo json_encode(array("code" => "1", "msg" => "min is null")); return; } else { $min = input_helper($_POST["min"]); } $supplider = input_helper($_POST["supplider"]); $phone = input_helper($_POST["phone"]); $count = input_helper($_POST["count"]); if (!is_numeric($min) || $min < 0) { echo json_encode(array("code" => "1", "msg" => "min is illegal")); return; } if (!is_numeric($max) || $max < $min) { echo json_encode(array("code" => "1", "msg" => "max is illegal")); return; } if (!is_numeric($count) || $count < $min || $count > $max) { echo json_encode(array("code" => "1", "msg" => "count is illegal")); return; } $apiHelper->productChange($id, $name, $code, $count, $supplider, $phone, $max, $min); }