fix: dshyhq 返回会员卡片图 card_image/card_bg

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-05 16:42:14 +08:00
parent aaf0c95925
commit 9dbca25b4d

View File

@@ -275,6 +275,12 @@ class DashouHuiyuanList(APIView):
'huiyuan_id', 'jieshao', 'jtjieshao', 'jiage',
).order_by('jiage')
from jituan.models import ClubHuiyuanPrice
club_rows = {
r.huiyuan_id: r
for r in ClubHuiyuanPrice.query.filter(club_id=club_id, is_enabled=True)
}
huiyuan_list = []
yonghuid = request.user.UserUID
for huiyuan in huiyuan_queryset:
@@ -287,6 +293,9 @@ class DashouHuiyuanList(APIView):
trial_sellable, trial_price, trial_days = club_huiyuan_sellable(
club_id, huiyuan.huiyuan_id, is_trial=True,
)
club_row = club_rows.get(huiyuan.huiyuan_id)
card_image = (club_row.card_image or '').strip() if club_row else ''
card_bg = (club_row.card_bg or '').strip() if club_row else ''
huiyuan_list.append({
'id': huiyuan.huiyuan_id,
'mingzi': huiyuan.jieshao,
@@ -297,6 +306,8 @@ class DashouHuiyuanList(APIView):
'trial_price': format_yuan(trial_price) if trial_sellable else '0.00',
'trial_days': trial_days if trial_sellable else 0,
'can_buy_trial': bool(trial_ok and trial_sellable),
'card_image': card_image,
'card_bg': card_bg,
})
# 5. 返回数据