mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
fix shop update goods
This commit is contained in:
parent
21ee3d5c3e
commit
4c5302bd4c
@ -249,6 +249,7 @@ __Docker 最新版本由 [Sakuracio](https://github.com/Sakuracio) 提供__
|
|||||||
* 优化商品显示图片,提供限制,限购,折扣提示
|
* 优化商品显示图片,提供限制,限购,折扣提示
|
||||||
* 修复图库内图片无法被连续删除的问题 [@pull/879](https://github.com/HibiKier/zhenxun_bot/pull/879)
|
* 修复图库内图片无法被连续删除的问题 [@pull/879](https://github.com/HibiKier/zhenxun_bot/pull/879)
|
||||||
* 色图提供配置项`MAX_ONCE_NUM2FORWARD`:群聊中单次发送图片数量达到指定时使用合并转发
|
* 色图提供配置项`MAX_ONCE_NUM2FORWARD`:群聊中单次发送图片数量达到指定时使用合并转发
|
||||||
|
* 优化修复了商品修改命令
|
||||||
|
|
||||||
### 2022/6/28
|
### 2022/6/28
|
||||||
|
|
||||||
|
|||||||
@ -288,11 +288,11 @@ async def update_goods(**kwargs) -> Tuple[bool, str, str]:
|
|||||||
new_time = time.strftime(
|
new_time = time.strftime(
|
||||||
"%Y-%m-%d %H:%M:%S",
|
"%Y-%m-%d %H:%M:%S",
|
||||||
time.localtime(time.time() + kwargs["limit_time"] * 60 * 60),
|
time.localtime(time.time() + kwargs["limit_time"] * 60 * 60),
|
||||||
)
|
) if kwargs["limit_time"] != 0 else 0
|
||||||
tmp += f"限时至: {new_time}\n"
|
tmp += f"限时至: {new_time}\n" if new_time else "取消了限时\n"
|
||||||
limit_time = kwargs["limit_time"]
|
limit_time = kwargs["limit_time"]
|
||||||
if kwargs.get("daily_limit"):
|
if kwargs.get("daily_limit"):
|
||||||
tmp += f'每日购买限制:{daily_limit} --> {kwargs["daily_limit"]}\n'
|
tmp += f'每日购买限制:{daily_limit} --> {kwargs["daily_limit"]}\n' if daily_limit else "取消了购买限制\n"
|
||||||
daily_limit = int(kwargs["daily_limit"])
|
daily_limit = int(kwargs["daily_limit"])
|
||||||
await GoodsInfo.update_goods(
|
await GoodsInfo.update_goods(
|
||||||
name,
|
name,
|
||||||
|
|||||||
@ -106,8 +106,8 @@ class GoodsInfo(db.Model):
|
|||||||
goods_price=goods_price or query.goods_price,
|
goods_price=goods_price or query.goods_price,
|
||||||
goods_description=goods_description or query.goods_description,
|
goods_description=goods_description or query.goods_description,
|
||||||
goods_discount=goods_discount or query.goods_discount,
|
goods_discount=goods_discount or query.goods_discount,
|
||||||
goods_limit_time=goods_limit_time or query.goods_limit_time,
|
goods_limit_time=goods_limit_time if goods_limit_time is not None else query.goods_limit_time,
|
||||||
daily_limit=daily_limit or query.daily_limit,
|
daily_limit=daily_limit if daily_limit is not None else query.daily_limit,
|
||||||
).apply()
|
).apply()
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -197,4 +197,3 @@ class GoodsInfo(db.Model):
|
|||||||
重置每次次数限制
|
重置每次次数限制
|
||||||
"""
|
"""
|
||||||
await cls.update.values(daily_purchase_limit={}).gino.status()
|
await cls.update.values(daily_purchase_limit={}).gino.status()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user