|
|
|
@@ -552,29 +552,26 @@ def batch_unbind_consumer_submit_api(request):
|
|
552
|
552
|
|
|
553
|
553
|
def exec_unbind_consumer_submit(pk, admin_id):
|
|
554
|
554
|
log_info = ConsumeInfoSubmitLogInfo.objects.get(pk=pk)
|
|
|
555
|
+
|
|
|
556
|
+ target_log_info = ConsumeInfoSubmitLogInfo.objects.get(model_id=log_info.model_id, serialNo=log_info.serialNo, dupload=False, unbound=False, status=True)
|
|
|
557
|
+
|
|
|
558
|
+ ConsumeInfoSubmitLogInfo.objects.filter(model_id=log_info.model_id, serialNo=log_info.serialNo).update(delete_type=ConsumeInfoSubmitLogInfo.UNBINDING, status=False)
|
|
555
|
559
|
|
|
556
|
|
- try:
|
|
557
|
|
- target_log_info = ConsumeInfoSubmitLogInfo.objects.get(model_id=log_info.model_id, serialNo=log_info.serialNo, dupload=False, unbound=False, status=True)
|
|
558
|
|
-
|
|
559
|
|
- ConsumeInfoSubmitLogInfo.objects.filter(model_id=log_info.model_id, serialNo=log_info.serialNo).update(delete_type=ConsumeInfoSubmitLogInfo.UNBINDING, status=False)
|
|
560
|
|
-
|
|
561
|
|
- user = UserInfo.objects.get(user_id=target_log_info.user_id)
|
|
562
|
|
-
|
|
563
|
|
- if user.shots_num <= 5:
|
|
564
|
|
- user.level -= 1
|
|
565
|
|
-
|
|
566
|
|
- user.integral -= target_log_info.integral
|
|
567
|
|
- user.integral = max(user.integral, 0)
|
|
568
|
|
-
|
|
569
|
|
- user.shots_num -= 1
|
|
570
|
|
-
|
|
571
|
|
- user.save()
|
|
572
|
|
-
|
|
573
|
|
- ConsumeShotUnbindingInfo.objects.update_or_create(user_id=target_log_info.user_id, submit_pk=target_log_info.submit_pk, defaults={
|
|
574
|
|
- 'model_id': target_log_info.model_id,
|
|
575
|
|
- 'sn': target_log_info.serialNo,
|
|
576
|
|
- 'submit_at': target_log_info.created_at,
|
|
577
|
|
- 'reason': admin_id + u'管理员删除',
|
|
578
|
|
- })
|
|
579
|
|
- except:
|
|
580
|
|
- ConsumeInfoSubmitLogInfo.objects.filter(model_id=log_info.model_id, serialNo=log_info.serialNo).update(delete_type=ConsumeInfoSubmitLogInfo.UNBINDING, status=False)
|
|
|
560
|
+ user = UserInfo.objects.get(user_id=target_log_info.user_id)
|
|
|
561
|
+
|
|
|
562
|
+ if user.shots_num <= 5:
|
|
|
563
|
+ user.level -= 1
|
|
|
564
|
+
|
|
|
565
|
+ user.integral -= target_log_info.integral
|
|
|
566
|
+ user.integral = max(user.integral, 0)
|
|
|
567
|
+
|
|
|
568
|
+ user.shots_num -= 1
|
|
|
569
|
+
|
|
|
570
|
+ user.save()
|
|
|
571
|
+
|
|
|
572
|
+ ConsumeShotUnbindingInfo.objects.update_or_create(user_id=target_log_info.user_id, submit_pk=target_log_info.submit_pk, defaults={
|
|
|
573
|
+ 'model_id': target_log_info.model_id,
|
|
|
574
|
+ 'sn': target_log_info.serialNo,
|
|
|
575
|
+ 'submit_at': target_log_info.created_at,
|
|
|
576
|
+ 'reason': admin_id + u'管理员解绑',
|
|
|
577
|
+ })
|