示例#1
0
class WeizoomCard(models.Model):
    """
	微众卡存储模型

	@note WeizoomCardHasAccount.account.id即owner_id
	"""
    owner = models.ForeignKey(User)
    target_user_id = models.IntegerField(default=0, verbose_name="微众卡发放目标")
    weizoom_card_rule = models.ForeignKey(WeizoomCardRule)
    status = models.IntegerField(default=WEIZOOM_CARD_STATUS_INACTIVE)  #微众卡状态
    weizoom_card_id = models.CharField(max_length=50)  #微众卡号
    money = models.DecimalField(max_digits=65, decimal_places=2)  #剩余金额
    password = models.CharField(max_length=50)  #微众卡密码
    expired_time = models.DateTimeField()  #过期时间
    is_expired = models.BooleanField(default=False)  #是否过期
    activated_at = models.DateTimeField(null=True)  #激活时间
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间
    remark = models.CharField(max_length=20, db_index=True)  #备注
    activated_to = models.CharField(max_length=20)  #申请人
    department = models.CharField(max_length=20)  #申请部门
    active_card_user_id = models.IntegerField(default=1)  #激活卡片人

    class Meta(object):
        db_table = 'market_tool_weizoom_card'
        verbose_name = '微众卡'
        verbose_name_plural = '微众卡'
示例#2
0
文件: models.py 项目: cash2one/gaia
class Session(models.Model):
    mpuser = models.ForeignKey(WeixinMpUser, related_name='owned_sessions')
    weixin_user = models.ForeignKey(WeixinUser,
                                    to_field='username',
                                    db_column='weixin_user_username')
    latest_contact_content = models.CharField(max_length=1024)  #最后一次交互消息内容
    latest_contact_created_at = models.DateTimeField(
        auto_now_add=True)  #最后一次交互时间
    is_latest_contact_by_viper = models.BooleanField(
        default=False)  #最后一次交互是否是客户发出的
    unread_count = models.IntegerField(default=0)  #未读消息数
    is_show = models.BooleanField(default=False)  #是否显示(是否填充对应的WeixinUser)
    created_at = models.DateTimeField(auto_now_add=True)
    weixin_created_at = models.CharField(max_length=50)  #微信平台提供的创建时间
    retry_count = models.IntegerField(default=0)  #重試次數
    #add by bert at 20.0
    message_id = models.IntegerField(default=0)
    #add by slzhu
    member_user_username = models.CharField(default='', max_length=100)
    member_message_id = models.IntegerField(default=0)
    member_latest_content = models.CharField(default='',
                                             max_length=1024)  #粉丝最近一条消息
    member_latest_created_at = models.CharField(default='',
                                                max_length=50)  #粉丝最近一条消息时间
    is_replied = models.BooleanField(default=False)  #是否回复过

    class Meta(object):
        ordering = ['-latest_contact_created_at']
        db_table = 'weixin_message_session'
示例#3
0
class MemberHasTag(models.Model):
    member = models.ForeignKey(Member)
    member_tag = models.ForeignKey(MemberTag)

    class Meta(object):
        db_table = 'member_has_tag'
        verbose_name = '会员所属分组'
        verbose_name_plural = '会员所属分组'
示例#4
0
class ProductHasPromotion(models.Model):
    """
	<商品,促销>的关联
	"""
    product = models.ForeignKey(mall_models.Product)
    promotion = models.ForeignKey(Promotion)

    class Meta(object):
        db_table = 'mallpromotion_product_has_promotion'
示例#5
0
class UserHasMessage(models.Model):
    user = models.ForeignKey(User)
    message = models.ForeignKey(Message)
    is_read = models.BooleanField(default=False)
    message_type = models.BooleanField(default=True)

    class Meta(object):
        db_table = 'message_user_has_message'
        verbose_name = '用户-系统消息'
        verbose_name_plural = '用户-系统消息'
示例#6
0
class ForbiddenCouponProduct(models.Model):
    owner = models.ForeignKey(User)
    product = models.ForeignKey(mall_models.Product)
    status = models.IntegerField(default=FORBIDDEN_STATUS_NOT_START)  #促销状态
    start_date = models.DateTimeField()  #开始日期
    end_date = models.DateTimeField()  #结束日期
    is_permanant_active = models.BooleanField(default=False)  #永久有效
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间

    class Meta(object):
        db_table = 'mall_forbidden_coupon_product'
示例#7
0
class WantToBuySupport(models.Model):
    """
	我想买支持记录
	"""
    want_to_buy = models.ForeignKey(WantToBuy)
    member = models.ForeignKey(Member)
    content = models.CharField(max_length=512)  #支持内容
    created_at = models.DateTimeField(auto_now_add=True)  #创建时间

    class Meta(object):
        db_table = 'member_want_to_buy_support'
示例#8
0
class MemberHasSocialAccount(models.Model):
    """
	<member, social_account>关联
	"""
    member = models.ForeignKey(Member)
    account = models.ForeignKey(SocialAccount)
    webapp_id = models.CharField(max_length=50)
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta(object):
        db_table = 'member_has_social_account'
示例#9
0
class VirtualProduct(models.Model):
    """
	福利卡券活动
	"""
    owner = models.ForeignKey(User)
    name = models.CharField(max_length=128)  #活动名称
    product = models.ForeignKey(mall_models.Product)  #活动关联的商品
    is_finished = models.BooleanField(default=False)  #活动是否结束
    created_at = models.DateTimeField(auto_now_add=True)  #创建时间

    class Meta(object):
        db_table = 'mallpromotion_virtual_product'
示例#10
0
class IntegralSaleRule(models.Model):
    """
	积分应用规则
	"""
    owner = models.ForeignKey(User)
    integral_sale = models.ForeignKey(IntegralSale)
    member_grade_id = models.IntegerField(default=0)  #会员等级
    discount = models.FloatField(default=0)  #折扣上限
    discount_money = models.FloatField(default=0.0)  #折扣金额

    class Meta(object):
        db_table = 'mallpromotion_integral_sale_rule'
        verbose_name = '积分应用规则'
        verbose_name_plural = '积分应用规则'
示例#11
0
class PremiumSaleProduct(models.Model):
    """
	买赠的赠品
	"""
    owner = models.ForeignKey(User)
    premium_sale = models.ForeignKey(PremiumSale)
    product = models.ForeignKey(mall_models.Product)
    count = models.IntegerField(default=1, verbose_name='赠送数量')
    unit = models.CharField(max_length=50, verbose_name='赠品单位')

    class Meta(object):
        db_table = 'mallpromotion_premium_sale_product'
        verbose_name = '买赠赠品'
        verbose_name_plural = '买赠赠品'
示例#12
0
文件: models.py 项目: cash2one/gaia
class ComponentAuthedAppid(models.Model):
    """
    参数  说明
    authorization_info  授权信息
    authorizer_appid    授权方appid
    authorizer_access_token 授权方令牌(在授权的公众号具备API权限时,才有此返回值)
    expires_in  有效期(在授权的公众号具备API权限时,才有此返回值)
    authorizer_refresh_token    刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于公众号第三方平台获取和刷新已授权用户的access_token,只会在授权时刻提供,请妥善保存。 一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌
    func_info   公众号授权给开发者的权限集列表(请注意,当出现用户已经将消息与菜单权限集授权给了某个第三方,再授权给另一个第三方时,由于该权限集是互斥的,后一个第三方的授权将去除此权限集,开发者可以在返回的func_info信息中验证这一点,避免信息遗漏),
    1到8分别代表:
    1消息与菜单权限集
    2用户管理权限集
    3帐号管理权限集
    4网页授权权限集
    5微信小店权限集
    6多客服权限集
    7业务通知权限集
    8微信卡券权限集

    """
    component_info = models.ForeignKey(ComponentInfo)
    auth_code = models.TextField(default='')
    user_id = models.IntegerField(default=0)  #对应帐号user id
    last_update_time = models.DateTimeField(default=datetime.now())
    authorizer_appid = models.CharField(max_length=255, default='')
    authorizer_access_token = models.TextField(default='')
    authorizer_refresh_token = models.TextField(default='')
    func_info = models.TextField(default='')
    created_at = models.DateTimeField(auto_now=True)
    is_active = models.BooleanField(default=False)

    class Meta(object):
        db_table = 'component_authed_appid'
        verbose_name = '委托授权帐号基本信息'
        verbose_name_plural = '委托授权帐号基本信息'
示例#13
0
class MarketToolsTemplateMessageDetail(models.Model):
    owner = models.ForeignKey(User, related_name='owner')
    template_message = models.ForeignKey(MarketToolsTemplateMessage)
    industry = models.IntegerField(default=INDUSTR_IT)
    template_id = models.TextField()  #模版id
    first_text = models.CharField(max_length=1024)
    remark_text = models.CharField(max_length=1024)
    type = models.IntegerField(default=MAJOR_INDUSTRY_TYPE)
    status = models.IntegerField(default=0)
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间

    class Meta(object):
        db_table = 'market_tools_template_message_detail'
        verbose_name = '模板消息详情'
        verbose_name_plural = 'market_tools_template_message_detail'
        ordering = ['-status', 'type']
示例#14
0
class WebApp(models.Model):
    owner = models.ForeignKey(User)
    appid = models.CharField(max_length=16)
    name = models.CharField(max_length=100, default='')

    class Meta(object):
        db_table = 'webapp'
示例#15
0
class WeizoomCardRule(models.Model):
    """
	微众卡规则
	"""
    owner = models.ForeignKey(User)
    name = models.CharField(max_length=20, db_index=True)  #名称
    money = models.DecimalField(max_digits=65, decimal_places=2)  #微众卡金额
    count = models.IntegerField(default=0)  #发放总数量
    remark = models.CharField(max_length=20, db_index=True)  #备注
    expired_time = models.DateTimeField()  #过期时间
    valid_time_from = models.DateTimeField()  #有效范围开始时间
    valid_time_to = models.DateTimeField()  #有效范围结束时间
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间
    card_type = models.IntegerField(default=WEIZOOM_CARD_EXTERNAL_USER)  #微众卡类型
    card_attr = models.IntegerField(default=0)  #微众卡属性
    shop_limit_list = models.CharField(max_length=2048, default='-1')  #专属商家
    shop_black_list = models.CharField(max_length=2048,
                                       default='-1')  #不能使用微众卡的商家
    is_new_member_special = models.BooleanField(default=False)  #是否为新会员专属卡
    valid_restrictions = models.DecimalField(max_digits=65,
                                             decimal_places=2)  #订单满多少可以使用规则

    class Meta(object):
        db_table = 'market_tool_weizoom_card_rule'
        verbose_name = '微众卡规则'
        verbose_name_plural = '微众卡规则'
示例#16
0
class CouponRule(models.Model):
    """
	优惠券规则
	"""
    owner = models.ForeignKey(User)
    name = models.CharField(max_length=20)  #名称
    valid_days = models.IntegerField(default=0)  #过期天数
    is_active = models.BooleanField(default=True)  #是否可用
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间
    start_date = models.DateTimeField()  #有效期开始时间
    end_date = models.DateTimeField()  #有效期结束时间
    # v2
    valid_restrictions = models.IntegerField(default=-1)  #订单满多少可以使用规则
    money = models.DecimalField()  #金额
    count = models.IntegerField(default=0)  #发放总数量
    remained_count = models.IntegerField(default=0)  #剩余数量
    limit_counts = models.IntegerField(default=0)  #每人限领
    limit_product = models.BooleanField(default=False)  #限制指定商品
    limit_product_id = models.CharField(max_length=2048, default=0)  #限制指定商品ID
    remark = models.TextField(default='')  #备注
    get_person_count = models.IntegerField(default=0)  #领取人数
    get_count = models.IntegerField(default=0)  #领取次数
    use_count = models.IntegerField(default=0)  #使用次数
    receive_rule = models.BooleanField(default=False)  #领取规则,仅未下单用户可领取

    class Meta(object):
        db_table = 'market_tool_coupon_rule'
示例#17
0
文件: models.py 项目: cash2one/gaia
class UserProfile(models.Model):
    """
	用户profile
	"""
    user = models.ForeignKey(User)
    manager_id = models.IntegerField(default=0)  #创建该用户的系统用户的id
    webapp_id = models.CharField(max_length=16)
    webapp_type = models.IntegerField(default=0)  #商城类型
    app_display_name = models.CharField(max_length=50,
                                        verbose_name='用于显示app名称',
                                        default='')
    is_active = models.BooleanField(default=True, verbose_name='用户是否有效')
    note = models.CharField(max_length=1024, default='')
    status = models.IntegerField(default=USER_STATUS_NORMAL)
    is_mp_registered = models.BooleanField(default=False,
                                           verbose_name='是否已经接入了公众账号')
    mp_token = models.CharField(max_length=50,
                                verbose_name='绑定公众号使用的token',
                                default='')
    mp_url = models.CharField(max_length=256,
                              verbose_name='公众号绑定的url',
                              default='')
    new_message_count = models.IntegerField(default=0)  #新消息数
    webapp_template = models.CharField(max_length=50,
                                       default='shop')  #webapp的模板
    is_customed = models.IntegerField(default=0)  #是否客户自定义CSS样式:1:是;0:否
    is_under_previewed = models.IntegerField(default=0)  #是否是预览模式:1:是;0:否
    expire_date_day = models.DateField(auto_now_add=True)
    force_logout_date = models.BigIntegerField(default=0)

    host_name = models.CharField(max_length=1024, default="")
    logout_redirect_to = models.CharField(max_length=1024, default="")
    system_name = models.CharField(max_length=64,
                                   default=u'微信营销管理系统',
                                   verbose_name='系统名称')
    system_version = models.CharField(max_length=16,
                                      default=SYSTEM_VERSION_TYPE_BASE,
                                      verbose_name='系统版本')

    homepage_template_name = models.CharField(max_length=250,
                                              default='')  #首页模板名
    backend_template_name = models.CharField(max_length=250,
                                             default='')  #后端页面模板名
    homepage_workspace_id = models.IntegerField(
        default=0)  #homepage workspace的id
    #add by bert
    account_type = models.IntegerField(default=SELF_OPERATION)  #帐号类型
    is_oauth = models.BooleanField(default=False)  #是否授权
    #v2
    sub_account_count = models.IntegerField(default=50)  #可创建的子账号的个数
    #wepage
    is_use_wepage = models.BooleanField(default=False)  #是否启用wepage
    store_name = models.CharField(max_length=64, default="")  #店铺名称
    #结算账期
    settlement_period = models.IntegerField(default=1)
    is_formal = models.BooleanField(default=True)  #账户类型是否是正式账号
    kefu_url = models.CharField(max_length=256, default="")  #客服url

    class Meta(object):
        db_table = 'account_user_profile'
示例#18
0
文件: models.py 项目: cash2one/gaia
class RealTimeInfo(models.Model):
    mpuser = models.ForeignKey(WeixinMpUser)
    unread_count = models.IntegerField(default=0, db_index=True)  #未读消息数

    class Meta(object):
        managed = False
        db_table = 'weixin_message_realtime_info'
        verbose_name = '微信消息实时状态信息'
        verbose_name_plural = '微信消息实时状态信息'
示例#19
0
class VirtualProductHasCode(models.Model):
    """
	福利卡券活动关联的卡券码
	"""
    owner = models.ForeignKey(User)
    virtual_product = models.ForeignKey(VirtualProduct)
    code = models.CharField(max_length=128)  #卡号
    password = models.CharField(max_length=512)  #密码
    start_time = models.DateTimeField()  #有效期起始时间
    end_time = models.DateTimeField()  #有效期结束时间
    status = models.IntegerField(default=CODE_STATUS_NOT_GET)  #状态
    get_time = models.DateTimeField(null=True)  #领取/发放时间
    member_id = models.CharField(max_length=20, default='')  #会员id
    oid = models.CharField(max_length=20, default='')  #订单id
    order_id = models.CharField(max_length=35, default='')  #订单order_id
    created_at = models.DateTimeField(auto_now_add=True)  #创建时间

    class Meta(object):
        db_table = 'mallpromotion_virtual_product_has_code'
示例#20
0
class UserOrderNotifySettings(models.Model):
    user = models.ForeignKey(User)
    emails = models.TextField(default='')  # '|'分割
    black_member_ids = models.TextField(default='')  # '|'分割,会员id
    status = models.IntegerField(default=0)
    is_active = models.BooleanField(default=False)
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta(object):
        db_table = 'user_order_notify_setting'
示例#21
0
class RedEnvelopeParticipences(models.Model):
    """
	红包领用记录
	"""
    owner = models.ForeignKey(User)
    coupon = models.ForeignKey(Coupon)
    red_envelope_rule_id = models.IntegerField(default=0)
    red_envelope_relation_id = models.IntegerField(default=0)
    member = models.ForeignKey(Member)
    is_new = models.BooleanField(default=False)
    introduced_by = models.IntegerField(default=0)  #由谁引入
    introduce_new_member = models.IntegerField(default=0)  #引入新关注
    introduce_used_number = models.IntegerField(default=0)  #引入使用人数
    introduce_received_number = models.IntegerField(default=0)  #引入领取人数
    introduce_sales_number = models.FloatField(default=0.0)  #引入消费额
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta(object):
        db_table = 'mall_red_envelope_participences'
示例#22
0
class Coupon(models.Model):
    """
	优惠券
	"""
    owner = models.ForeignKey(User)
    coupon_rule = models.ForeignKey(CouponRule)  #coupon rule
    member_id = models.IntegerField(default=0)  #优惠券分配的member的id
    coupon_record_id = models.IntegerField(default=0)  #优惠券记录的id
    status = models.IntegerField(default=COUPON_STATUS_UNUSED)  #优惠券状态
    coupon_id = models.CharField(max_length=50)  #优惠券号
    provided_time = models.DateTimeField(default=DEFAULT_DATETIME)  #领取时间
    start_time = models.DateTimeField()  #优惠券有效期开始时间
    expired_time = models.DateTimeField()  #过期时间
    money = models.FloatField()  #金额
    is_manual_generated = models.BooleanField(default=False)  #是否手工生成
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间

    class Meta(object):
        db_table = 'market_tool_coupon'
示例#23
0
class MemberBrowseRecord(models.Model):
    member = models.ForeignKey(Member)
    title = models.CharField(max_length=256, default='')  #页面标题
    url = models.TextField()
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta(object):
        db_table = 'member_browse_record'
        verbose_name = '会员浏览记录'
        verbose_name_plural = '会员浏览记录'
示例#24
0
class OperationSettings(models.Model):
    """
	运营配置
	"""
    owner = models.ForeignKey(User, unique=True)
    non_member_followurl = models.CharField(max_length=1024, default='')
    weshop_followurl = models.CharField(max_length=1024, default='')

    class Meta(object):
        db_table = 'account_operation_settings'
示例#25
0
文件: models.py 项目: cash2one/gaia
class Material(models.Model):
    owner = models.ForeignKey(User, related_name='owned_materials')
    type = models.IntegerField(default=SINGLE_NEWS_TYPE,
                               choices=MATERIAL_TYPES)
    created_at = models.DateTimeField(auto_now_add=True)
    is_deleted = models.BooleanField(default=False)  #是否删除

    class Meta(object):
        db_table = 'material_material'
        verbose_name = '素材'
        verbose_name_plural = '素材'
示例#26
0
文件: models.py 项目: cash2one/gaia
class MpuserPreviewInfo(models.Model):
    """
    微信公众账号预览信息
    """
    mpuser = models.ForeignKey(WeixinMpUser)
    name = models.CharField(max_length=100)  #预览显示的名字
    image_path = models.CharField(max_length=500,
                                  default=DEFAULT_ICON)  #预览显示的图片

    class Meta(object):
        db_table = 'account_mpuser_preview_info'
示例#27
0
class AccessToken(models.Model):
    app = models.ForeignKey(App)
    access_token = models.CharField(max_length=256)
    expires_in = models.CharField(max_length=100, verbose_name='expires_in')
    is_active = models.BooleanField(default=False)

    created_at = models.DateTimeField(auto_now_add=True)

    class Meta:
        db_table = 'access_token'
        verbose_name = 'access_token'
        verbose_name_plural = 'access_token'
示例#28
0
class MarketToolsTemplateMessageSendRecord(models.Model):
    owner = models.ForeignKey(User, related_name='user')
    template_id = models.TextField()  #模版id
    member_id = models.IntegerField(default=0)
    status = models.IntegerField(default=0)
    order_id = models.CharField(max_length=200, default='')
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间

    class Meta(object):
        db_table = 'market_tools_template_message_send_record'
        verbose_name = '模板消息发送记录'
        verbose_name_plural = 'market_tools_template_message_send_record'
示例#29
0
class PremiumSale(models.Model):
    """
	买赠
	"""
    owner = models.ForeignKey(User)
    count = models.IntegerField(default=0)  #购买基数
    is_enable_cycle_mode = models.BooleanField(default=False)  #循环买赠

    class Meta(object):
        db_table = 'mallpromotion_premium_sale'
        verbose_name = '买赠'
        verbose_name_plural = '买赠'
示例#30
0
class PriceCut(models.Model):
    """
	满减
	"""
    owner = models.ForeignKey(User)
    price_threshold = models.FloatField(default=0)  #价格阈值
    cut_money = models.FloatField(default=0)  #减价
    is_enable_cycle_mode = models.BooleanField(default=False)  #是否启用循环满减

    class Meta(object):
        db_table = 'mallpromotion_price_cut'
        verbose_name = '满减'
        verbose_name_plural = '满减'