Aucune description

FKCouponItem.m 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // FKCouponItem.m
  3. // FirstLink
  4. //
  5. // Created by ascii on 16/4/9.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKCouponItem.h"
  9. @implementation FKCouponItem
  10. + (NSDictionary *)mts_mapping {
  11. return @{@"id": mts_key(itemID),
  12. @"code": mts_key(code),
  13. @"amount": mts_key(amount),
  14. @"start_date": mts_key(startDate),
  15. @"expiry_date": mts_key(expiryDate),
  16. @"min_use_amount": mts_key(minUseAmount),
  17. @"remain_count": mts_key(remainCount),
  18. @"type": mts_key(type),
  19. @"type_desc": mts_key(typeDesc),
  20. @"description": mts_key(desc),
  21. @"time_description": mts_key(timeDesc),
  22. @"sale_activity_name": mts_key(saleActivityName),
  23. @"target_user": mts_key(targetUser),
  24. @"target_goods": mts_key(targetGoods),
  25. @"discount_rule": mts_key(discountRule),
  26. @"status": mts_key(status),
  27. @"use_mark": mts_key(useMark),
  28. @"create_time": mts_key(createTime),
  29. @"target_url" : mts_key(targetUrl)
  30. };
  31. }
  32. + (BOOL)mts_shouldSetUndefinedKeys {
  33. return NO;
  34. }
  35. -(FKCouponType)getCouponType{
  36. if ([self.type isEqualToString:@"1"]) {
  37. return FKCouponTypeMoney;
  38. }else if ([self.type isEqualToString:@"2"]){
  39. return FKCouponTypePostage;
  40. }else if ([self.type isEqualToString:@"3"]){
  41. return FKCouponTypeAcitivityCard;
  42. }
  43. return FKCouponTypeNone;
  44. }
  45. - (BOOL)isCouponValid{
  46. if ([self.status isEqualToString:@"1"]) {
  47. return YES;
  48. }
  49. return NO;
  50. }
  51. @end