@@ -445,8 +445,13 @@ def consumer_info_api(request): |
||
445 | 445 |
user.shots_num += 1 |
446 | 446 |
user.integral += model.shot_member_integral |
447 | 447 |
# 配件不增加会员等级,只发放积分。 |
448 |
+ to_send_coupon = False |
|
448 | 449 |
if user.level < UserInfo.MEMBER_BLACK_GOLD and model.shot_type_id != 'V6PkivthL4sdADp4GNpQ4C': |
449 | 450 |
user.level += 1 |
451 |
+ to_send_coupon = True |
|
452 |
+ user.save() |
|
453 |
+ |
|
454 |
+ if to_send_coupon: |
|
450 | 455 |
# 发放会员权益 |
451 | 456 |
r.rpushjson(MEMBER_SEND_COUPON_LIST, { |
452 | 457 |
'brand_id': brand.brand_id, |
@@ -455,8 +460,6 @@ def consumer_info_api(request): |
||
455 | 460 |
# 会员升级提示 |
456 | 461 |
r.set(MEMBER_UPGRADE_INFO % (brand.brand_id, user_id), 1) |
457 | 462 |
|
458 |
- user.save() |
|
459 |
- |
|
460 | 463 |
return response(200, 'Submit Consumer Info Success', u'提交消费者信息成功') |
461 | 464 |
|
462 | 465 |
|
@@ -37,6 +37,9 @@ class Command(CompatibilityBaseCommand): |
||
37 | 37 |
user_id = v.get('user_id', '') |
38 | 38 |
coupon_id = v.get('coupon_id', '') |
39 | 39 |
|
40 |
+ # TODO: Opt by delay execute |
|
41 |
+ time.sleep(5) |
|
42 |
+ |
|
40 | 43 |
try: |
41 | 44 |
user = UserInfo.objects.get(user_id=user_id) |
42 | 45 |
except UserInfo.DoesNotExist: |