def calc_sub_total(sales, goods_name):
    """
    统计指定商品的销售额
    :param sales: 销售记录列表
    :param goods_name: 要统计的商品名
    :return: 指定商品的销售额
    """
    total = 0
    for s in sales:
        if s.name == goods_name:
            amount = s.price * s.quantity
            total += amount
    return total