예제 #1
0
파일: add.php 프로젝트: ASSASSINOR/WMS
    } else {
        $code = input_helper($_POST["code"]);
    }
    if ($_POST["count"] == '') {
        echo json_encode(array("code" => "1", "msg" => "count is null"));
        return;
    } else {
        $count = input_helper($_POST["count"]);
    }
    if ($_POST["price"] == '') {
        echo json_encode(array("code" => "1", "msg" => "price is null"));
        return;
    } else {
        $price = input_helper($_POST["price"]);
    }
    if ($_POST["charge"] == '') {
        echo json_encode(array("code" => "1", "msg" => "charge is null"));
        return;
    } else {
        $charge = input_helper($_POST["charge"]);
    }
    if (!is_numeric($count) || $count < 0) {
        echo json_encode(array("code" => "1", "msg" => "count is illegal"));
        return;
    }
    if (!is_float($price) && !is_numeric($price) || $price < 0) {
        echo json_encode(array("code" => "1", "msg" => "price is illegal"));
        return;
    }
    $apiHelper->warehouseAdd($orderid, $name, $code, $count, $price, $charge);
}