Пример #1
0
def send_admin(notice_name, config, admin_account,
               data):  #通知途径+管理员接收账号+msg信息[data['contact']+data['name']订单名]
    # 系统开关检测:邮箱、短信、TG、微信
    # 具体执行
    if notice_name == '邮箱通知':
        try:
            mail_to_admin(config, admin_account, data)
        except Exception as e:
            # log('邮箱通知失败 ')  #
            print(e)  #通知失败
    elif notice_name == '短信通知':
        try:
            sms_to_admin(config, admin_account, data)
        except Exception as e:
            # log('短信通知失败 ')  #
            print(e)  #通知失败
    elif notice_name == '微信通知':
        try:
            # print('微信通知')
            wxpush(config, admin_account, data)
        except Exception as e:
            # log('微信通知失败 ')  #
            print(e)  #通知失败

    elif notice_name == 'TG通知':
        try:
            post_tg(config, admin_account, data)
        except Exception as e:
            # log('TG通知失败 ')  #
            print(e)  #通知失败
    else:
        print('接口参数错误')
Пример #2
0
def send_admin(notice_name,config,admin_account,data):  #通知途径+管理员接收账号+msg信息[data['contact']+data['name']订单名]
    # 系统开关检测:邮箱、短信、TG、微信
    # 具体执行
    if notice_name == '邮箱通知':
        try:
            mail_to_admin(config,admin_account,data)
        except Exception as e:
            log('邮箱通知失败 ')  #          
            log(e)  #通知失败           
    elif notice_name == '短信通知':
        try:
            sms_to_admin(config,admin_account,data)
        except Exception as e:
            log('短信通知失败 ')  #          
            log(e)  #通知失败              
    elif notice_name == '微信通知':
        try:
            # print('微信通知')
            wxpush(config,admin_account,data)     
        except Exception as e:
            log('微信通知失败 ')  #          
            log(e)  #通知失败             
        
    elif notice_name == 'TG通知':
        try:
            post_tg(config,admin_account,data)    
        except Exception as e:
            log('TG通知失败 ')  #          
            log(e)  #通知失败             
    elif notice_name == 'QQ通知':
        try:
            qqpush(config,admin_account,data)    
        except Exception as e:
            log('QQ通知失败 ')  #          
            log(e)  #通知失败                 
    else:
        print('接口参数错误')
        log('接口参数错误')  #通知失败 




## 库存检测。首页第一步返回数商品检测(已上架产品);挨个检测商品库存数量:根据商品名检索,求sum值,结果:if重复卡密--充足;else:sum>10充足,否则少量;sum为0时缺货
# 库存统计
# Card.query.filter_by(prod_name = '香港ID').count()  ==》3

# 卡密添加:单一卡密无限重复使用及开关。