瀏覽代碼

基础设置

wushaodong 4 年之前
父節點
當前提交
e3adaf14d3
共有 2 個文件被更改,包括 2 次插入0 次删除
  1. 1 0
      apps/tenant/models.py
  2. 1 0
      apps/tenant/views.py

+ 1 - 0
apps/tenant/models.py

@@ -159,6 +159,7 @@ class Pay(models.Model):
         self.tenant.status = settings.PASS
         self.tenant.edition = self.edition_year.split(',')[0]
         self.tenant.save()
+        Pay.objects.filter(tenant=self.tenant,amount__isnull=True).delete()
 
     # 支付宝回调,付款
     def payConfirm(self, no):

+ 1 - 0
apps/tenant/views.py

@@ -90,6 +90,7 @@ class CompanyViewSet(CustomModelViewSet):
 
         try:
             with transaction.atomic():
+                Pay.objects.filter(tenant=request.user.employee.tenant, amount__isnull=True).delete()
                 if int(pay_channel) == Pay.WECHAT:
                     line_data = Pay.wechatPay(request.user, pk ,amount, edition_year)
                 elif int(pay_channel) == Pay.ALIPAY: