Skip to content

Commit 458cab8

Browse files
author
li6185377
committed
fix long type use int value
1 parent df10240 commit 458cab8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

LKDBHelper/Helper/NSObject+LKModel.m

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,14 @@ -(void)modelSetValue:(LKDBProperty *)property value:(id)value
182182
}
183183
else if([LKSQL_Convert_IntType rangeOfString:columnType].location != NSNotFound)
184184
{
185-
modelValue = [NSNumber numberWithInteger:[value intValue]];
185+
if([columnType isEqualToString:@"long"])
186+
{
187+
modelValue = [NSNumber numberWithLongLong:[value longLongValue]];
188+
}
189+
else
190+
{
191+
modelValue = [NSNumber numberWithInteger:[value intValue]];
192+
}
186193
}
187194
else if([columnType isEqualToString:@"NSDate"])
188195
{
@@ -422,7 +429,7 @@ + (void)getSelfPropertys:(NSMutableArray *)pronames protypes:(NSMutableArray *)p
422429
else
423430
{
424431
propertyType = [propertyType lowercaseString];
425-
if ([propertyType hasPrefix:@"ti"] || [propertyType hasPrefix:@"tq"] || [propertyType hasPrefix:@"tb"])
432+
if ([propertyType hasPrefix:@"ti"] || [propertyType hasPrefix:@"tb"])
426433
{
427434
[protypes addObject:@"int"];
428435
}
@@ -433,7 +440,7 @@ + (void)getSelfPropertys:(NSMutableArray *)pronames protypes:(NSMutableArray *)p
433440
else if([propertyType hasPrefix:@"td"]) {
434441
[protypes addObject:@"double"];
435442
}
436-
else if([propertyType hasPrefix:@"tl"])
443+
else if([propertyType hasPrefix:@"tl"] || [propertyType hasPrefix:@"tq"])
437444
{
438445
[protypes addObject:@"long"];
439446
}

0 commit comments

Comments
 (0)