优化逻辑

FFIB 2 ヶ月 前
コミット
a9ca739aed
共有1 個のファイルを変更した7 個の追加2 個の削除を含む
  1. 7 2
      api/mch_views.py

+ 7 - 2
api/mch_views.py

@@ -556,9 +556,14 @@ def consumer_shot_unbinding(request):
556 556
         log_info = ConsumeInfoSubmitLogInfo.objects.get(pk=submit_pk)
557 557
         ConsumeInfoSubmitLogInfo.objects.filter(model_id=model_id, serialNo=sn).update(delete_type=ConsumeInfoSubmitLogInfo.UNBINDING, status=False)
558 558
         if not log_info.unbound:
559
-            user.level -= 1
560
-            user.shots_num -= 1
559
+            if user.shots_num <= 5:
560
+                user.level -= 1
561
+
561 562
             user.integral -= log_info.integral
563
+            user.integral = max(user.integral, 0)
564
+            
565
+            user.shots_num -= 1
566
+
562 567
         
563 568
         user.save()
564 569