feat: add modal shop and lottery management
This commit is contained in:
@@ -155,6 +155,23 @@ class ShopItem(TimestampMixin, Model):
|
||||
indexes = (("chat_id", "enabled"),)
|
||||
|
||||
|
||||
class ShopTransaction(TimestampMixin, Model):
|
||||
"""积分商城交易记录"""
|
||||
id = fields.BigIntField(pk=True, generated=True)
|
||||
chat_id = fields.BigIntField(default=0)
|
||||
user_id = fields.BigIntField()
|
||||
username = fields.CharField(max_length=255, null=True)
|
||||
item_key = fields.CharField(max_length=50)
|
||||
item_name = fields.CharField(max_length=255)
|
||||
cost = fields.IntField(default=0)
|
||||
status = fields.CharField(max_length=30, default="success")
|
||||
note = fields.CharField(max_length=500, null=True)
|
||||
|
||||
class Meta:
|
||||
table = "shop_transactions"
|
||||
indexes = (("chat_id", "created_at"), ("chat_id", "user_id"), ("item_key", "created_at"),)
|
||||
|
||||
|
||||
class LotteryEvent(TimestampMixin, Model):
|
||||
"""群内抽奖活动"""
|
||||
id = fields.BigIntField(pk=True, generated=True)
|
||||
@@ -162,6 +179,11 @@ class LotteryEvent(TimestampMixin, Model):
|
||||
message_id = fields.BigIntField(null=True)
|
||||
creator_id = fields.BigIntField()
|
||||
creator_name = fields.CharField(max_length=255, null=True)
|
||||
title = fields.CharField(max_length=255, null=True)
|
||||
description = fields.TextField(null=True)
|
||||
draw_type = fields.CharField(max_length=50, default="people") # instant/people/time/manual
|
||||
draw_at = fields.DatetimeField(null=True)
|
||||
max_participants = fields.IntField(default=0)
|
||||
prize = fields.CharField(max_length=500)
|
||||
condition_type = fields.CharField(max_length=50, default="all") # all/checkin/min_points
|
||||
condition_value = fields.IntField(default=0)
|
||||
|
||||
Reference in New Issue
Block a user