/** * TransOpenApiModel::usCalcShipCost() * 海外仓运输方式+运费计算 * @param float $weight 重量 * @param string $postcode 邮编 * @param string $other 其它待定(暂不用) * @return array; */ public static function act_usCalcShipCost() { $weight = isset($_REQUEST['weight']) ? abs(floatval($_REQUEST['weight'])) : 0; $other = isset($_REQUEST['other']) ? trim($_REQUEST['other']) : ''; $postcode = isset($_REQUEST['postcode']) ? trim($_REQUEST['postcode']) : ''; if (empty($weight) || !is_numeric($weight)) { self::$errCode = "重量有误!"; self::$errMsg = 10000; return false; } if (empty($postcode)) { self::$errCode = "邮政编码有误!"; self::$errMsg = 10001; return false; } $res = TransOpenApiModel::usCalcShipCost($weight, $postcode, $other); self::$errCode = TransOpenApiModel::$errCode; self::$errMsg = TransOpenApiModel::$errMsg; return $res; }