wangfei 6 vuotta sitten
vanhempi
commit
85f8e5d9a2
2 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 2
    2
      service/card/card.go
  2. 2
    2
      service/coupon/coupon.go

+ 2
- 2
service/card/card.go Näytä tiedosto

@@ -71,10 +71,10 @@ func (s *CardServ) GetCardList(caseID, sendtype, usetype string, pagenavi ...int
71 71
 		if usetype != "" {
72 72
 			switch usetype {
73 73
 			case models.COUPONCARD_USETYPE_LUCKDRAW:
74
-				filters = append(filters, "card_id not in (select resource_id from sys_activity_action where active_type='"+models.ActGiveCard+"')")
74
+				filters = append(filters, "card_id not in (select resource_id from sys_activity_action where active_type='"+models.ActGiveCard+"') and used_count=0")
75 75
 				break
76 76
 			case models.COUPONCARD_USETYPE_SYS:
77
-				filters = append(filters, "card_id not in (select coupon_card_id from ta_luckdraw_record where coupon_card_type='"+models.PRIZE_TYPE_CARD+"')")
77
+				filters = append(filters, "card_id not in (select coupon_card_id from ta_luckdraw_record where coupon_card_type='"+models.PRIZE_TYPE_CARD+"') and used_count=0")
78 78
 				break
79 79
 			}
80 80
 		}

+ 2
- 2
service/coupon/coupon.go Näytä tiedosto

@@ -66,10 +66,10 @@ func (s *CouponServ) GetCouponList(caseID, sendtype, usetype string, pagenavi ..
66 66
 		if usetype != "" {
67 67
 			switch usetype {
68 68
 			case models.COUPONCARD_USETYPE_LUCKDRAW:
69
-				filters = append(filters, "coupon_id not in (select resource_id from sys_activity_action where active_type='"+models.ActGiveCoupon+"')")
69
+				filters = append(filters, "coupon_id not in (select resource_id from sys_activity_action where active_type='"+models.ActGiveCoupon+"') and used_count=0")
70 70
 				break
71 71
 			case models.COUPONCARD_USETYPE_SYS:
72
-				filters = append(filters, "coupon_id not in (select coupon_card_id from ta_luckdraw_record where coupon_card_type='"+models.PRIZE_TYPE_COUPON+"')")
72
+				filters = append(filters, "coupon_id not in (select coupon_card_id from ta_luckdraw_record where coupon_card_type='"+models.PRIZE_TYPE_COUPON+"') and used_count=0")
73 73
 				break
74 74
 			}
75 75
 		}