|
|
|
@@ -90,7 +90,15 @@ def lottery_mp_entry_save_api(request):
|
|
90
|
90
|
def lottery_mp_campaign_list_api(request):
|
|
91
|
91
|
"""小程序:活动列表(公开,不需要登录),供抽奖专区页展示"""
|
|
92
|
92
|
user = _get_user(request.POST.get('user_id', ''))
|
|
93
|
|
- campaigns = LotteryCampaignInfo.objects.filter(status=True).order_by('-created_at')[:10]
|
|
|
93
|
+ campaign_id = request.POST.get('campaign_id', '')
|
|
|
94
|
+
|
|
|
95
|
+ # 传了活动ID就精确查那一条(详情页用),否则返回最近的若干个
|
|
|
96
|
+ campaigns = LotteryCampaignInfo.objects.filter(status=True).order_by('-created_at')
|
|
|
97
|
+
|
|
|
98
|
+ if campaign_id:
|
|
|
99
|
+ campaigns = campaigns.filter(campaign_id=campaign_id)
|
|
|
100
|
+ else:
|
|
|
101
|
+ campaigns = campaigns[:10]
|
|
94
|
102
|
|
|
95
|
103
|
data = []
|
|
96
|
104
|
|