|
|
|
@@ -284,8 +284,12 @@ def activity_signup_audit(request, administrator):
|
|
284
|
284
|
info = MemberActivitySignupInfo.objects.get(activity_id=activity_id, signup_id=signup_id, status=True)
|
|
285
|
285
|
info.audit_status = audit_status
|
|
286
|
286
|
info.save()
|
|
287
|
|
- if activity_id == 'LAQbd9qXauqeUHFtwr9B76' and audit_status == MemberActivitySignupInfo.PASSED:
|
|
288
|
|
- res = handle_student_signup_passed(activity_id, info, administrator)
|
|
|
287
|
+ if activity_id == 'LAQbd9qXauqeUHFtwr9B76':
|
|
|
288
|
+ if audit_status == MemberActivitySignupInfo.PASSED:
|
|
|
289
|
+ res = handle_student_signup_passed(activity_id, info, administrator)
|
|
|
290
|
+ elif audit_status == MemberActivitySignupInfo.UNPASSED:
|
|
|
291
|
+ res = handle_student_signup_unpassed(activity_id, info, administrator)
|
|
|
292
|
+
|
|
289
|
293
|
return response(200, 'Member Activity Signup Audit Success1', u'活动审核成功', data=res)
|
|
290
|
294
|
|
|
291
|
295
|
except Exception as e:
|
|
|
|
@@ -295,8 +299,6 @@ def activity_signup_audit(request, administrator):
|
|
295
|
299
|
|
|
296
|
300
|
def handle_student_signup_passed(activity_id, info, administrator):
|
|
297
|
301
|
act = MemberActivityInfo.objects.get(activity_id=activity_id)
|
|
298
|
|
- wxcfg = WECHAT.get('MINIAPP', {})
|
|
299
|
|
- appid = wxcfg.get('appID')
|
|
300
|
302
|
user = UserInfo.objects.get(user_id=info.user_id)
|
|
301
|
303
|
|
|
302
|
304
|
coupon = CouponInfo.objects.get(coupon_id='854A3VUAsdr3euALEpuXmM')
|
|
|
|
@@ -332,3 +334,20 @@ def handle_student_signup_passed(activity_id, info, administrator):
|
|
332
|
334
|
}, miniprogram_state="trial", lang=None, page='/pages/member/activity/activity?signup_id={}'.format(info.signup_id))
|
|
333
|
335
|
|
|
334
|
336
|
return res
|
|
|
337
|
+
|
|
|
338
|
+def handle_student_signup_unpassed(activity_id, info):
|
|
|
339
|
+ act = MemberActivityInfo.objects.get(activity_id=activity_id)
|
|
|
340
|
+ user = UserInfo.objects.get(user_id=info.user_id)
|
|
|
341
|
+ res = sendwxasubscribemessage(openid=user.openid_miniapp, template_id=settings.TEMPLATE_ID_ACTIVITY_STUDENT, data={
|
|
|
342
|
+ "thing2": {
|
|
|
343
|
+ "value": act.title
|
|
|
344
|
+ },
|
|
|
345
|
+ "phrase1": {
|
|
|
346
|
+ "value": u"审核不通过"
|
|
|
347
|
+ },
|
|
|
348
|
+ "thing5": {
|
|
|
349
|
+ "value": u"感谢您对腾龙活动的支持"
|
|
|
350
|
+ }
|
|
|
351
|
+ }, miniprogram_state="trial", lang=None, page='/pages/member/activity/activity')
|
|
|
352
|
+
|
|
|
353
|
+ return res
|