1234567891011121314151617181920212223242526272829303132333435363738394041 |
- //
- // DiscountItem.m
- // FirstLink
- //
- // Created by jack on 15/6/27.
- // Copyright (c) 2015年 FirstLink. All rights reserved.
- //
- #import "CashCouponUseItem.h"
- @implementation CashCouponUseItem
- + (NSDictionary *)mts_mapping
- {
- return @{@"min_amount" : mts_key(minAmount),
- @"max_amount" : mts_key(maxAmount),
- @"cash_coupon_amount" : mts_key(cashAmount)
- };
- }
- + (BOOL)mts_shouldSetUndefinedKeys
- {
- return NO;
- }
- - (BOOL)isContainWithUnitPrice:(CGFloat)unitPrice
- {
- if (unitPrice <= 0) return NO;
- NSString *minAmountStr = [FLStringHelper convertFenToYuan:self.minAmount];
- NSString *maxAmountStr = [FLStringHelper convertFenToYuan:self.maxAmount];
- // NSString *amountStr = [FLStringHelper convertFenToYuan:self.cashAmount];
-
- CGFloat minAmount = minAmountStr.floatValue;
- CGFloat maxAmount = maxAmountStr.floatValue;
- // CGFloat cashMount = amountStr.floatValue;
-
- if (maxAmount == 0 && unitPrice > minAmount) return YES;
- if (unitPrice > minAmount && unitPrice <= maxAmount) return YES;
- return NO;
-
- }
- @end
|