Skip to content

Commit 6f61e04

Browse files
committed
chore: 更新plan字段
1 parent 548572d commit 6f61e04

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/plan/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ def get_plan_cache():
99

1010
global _plan_cache
1111
if not _plan_cache or (now - _plan_cache[1] > CacheExpiration):
12-
_plan_cache = (Plan.select().where(Plan.available == True).order_by(Plan.plan_index), now)
12+
_plan_cache = (Plan.select().order_by(Plan.plan_index), now)
1313

1414
return _plan_cache[0]

src/plan/details.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ async def query_details(plan_id: str):
2323
"ec": 200,
2424
"data": {
2525
"title": p.title,
26+
"type_id": p.type_id,
2627
"price": p.price,
2728
"original_price": p.original_price,
2829
"popular": p.popular,

src/plan/summary.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ async def query_plan(type_id: str = "GameTools"):
2020
}
2121

2222
for p in get_plan_cache():
23+
if not p.available:
24+
continue
25+
2326
if p.type_id == type_id:
2427
data["home"].append(
2528
{

0 commit comments

Comments
 (0)