Beispiel #1
0
def purchase_self(request):
    # 自身充值
    try:
        char_id = int(request.POST['char_id'])
        goods_id = int(request.POST['goods_id'])
        amount = int(request.POST['amount'])
    except:
        return {'ret': 1}

    for i in range(amount):
        p = BasePurchaseAction(char_id)
        p.send_reward(goods_id)

    # 额外赠送30%
    addition_sycee = PURCHASE[goods_id].sycee * amount * 0.3
    p = BasePurchaseAction(char_id)
    p.send_addition_sycee_via_mail(int(addition_sycee))

    return {'ret': 0}
Beispiel #2
0
def purchase_self(request):
    # 自身充值
    try:
        char_id = int(request.POST['char_id'])
        goods_id = int(request.POST['goods_id'])
        amount = int(request.POST['amount'])
    except:
        return {'ret': 1}

    for i in range(amount):
        p = BasePurchaseAction(char_id)
        p.send_reward(goods_id)

    # 额外赠送30%
    addition_sycee = PURCHASE[goods_id].sycee * amount * 0.3
    p = BasePurchaseAction(char_id)
    p.send_addition_sycee_via_mail(int(addition_sycee))

    return {'ret': 0}