You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
563 B
22 lines
563 B
# -*- coding:utf-8 -*-
|
|
from tortoise import fields
|
|
from tortoise import models
|
|
|
|
|
|
class BarcodeBuilders(models.Model):
|
|
id = fields.IntField(pk=True)
|
|
index = fields.BigIntField(default=1)
|
|
|
|
class Meta:
|
|
table = 'barcode_builders'
|
|
table_description = 'barcode生成值表'
|
|
|
|
@classmethod
|
|
async def get_barcode_index(cls):
|
|
data = await cls.get(id=1).values("id", "index")
|
|
return data.get("index")
|
|
|
|
@classmethod
|
|
async def update_barcode_index(cls, value):
|
|
await cls.filter(id=1).update(index=value)
|