|
@@ -2494,6 +2494,8 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
NSData* json =nil;
|
|
NSData* json =nil;
|
|
|
json=[NSData dataWithContentsOfFile:img_cache];
|
|
json=[NSData dataWithContentsOfFile:img_cache];
|
|
|
|
|
+ if(json==nil)
|
|
|
|
|
+ return nil;
|
|
|
NSError *error=nil;
|
|
NSError *error=nil;
|
|
|
NSMutableDictionary* menu = [[NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error] mutableCopy];
|
|
NSMutableDictionary* menu = [[NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error] mutableCopy];
|
|
|
|
|
|
|
@@ -2572,7 +2574,11 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
NSString* sqlQuery = nil;
|
|
NSString* sqlQuery = nil;
|
|
|
if(appDelegate.contact_id==nil)
|
|
if(appDelegate.contact_id==nil)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(!appDelegate.bLogin)
|
|
|
|
|
+ return nil;
|
|
|
sqlQuery=[NSString stringWithFormat:@"select a.name,b.price,b.type from price as a left join model_price as b on a.name=b.price_name and b.item_id=%d order by a.order_by;",item_id];
|
|
sqlQuery=[NSString stringWithFormat:@"select a.name,b.price,b.type from price as a left join model_price as b on a.name=b.price_name and b.item_id=%d order by a.order_by;",item_id];
|
|
|
|
|
+ }
|
|
|
else
|
|
else
|
|
|
sqlQuery=[NSString stringWithFormat:@"select a.name,b.price,b.type from price as a left join model_price as b on a.name=b.price_name and b.item_id=%d and b.price_name in(%@) order by a.order_by;",item_id,whereprice];
|
|
sqlQuery=[NSString stringWithFormat:@"select a.name,b.price,b.type from price as a left join model_price as b on a.name=b.price_name and b.item_id=%d and b.price_name in(%@) order by a.order_by;",item_id,whereprice];
|
|
|
sqlite3_stmt * statement;
|
|
sqlite3_stmt * statement;
|
|
@@ -2623,7 +2629,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// int type= sqlite3_column_int(statement, 2);
|
|
// int type= sqlite3_column_int(statement, 2);
|
|
|
-// item[@"type"]=[NSNumber numberWithInt:type ];
|
|
|
|
|
|
|
+ //item[@"type"]=@"price";
|
|
|
// item[nsname]= nsprice;
|
|
// item[nsname]= nsprice;
|
|
|
|
|
|
|
|
ret[[NSString stringWithFormat:@"item_%d",count]]= item;
|
|
ret[[NSString stringWithFormat:@"item_%d",count]]= item;
|
|
@@ -3299,7 +3305,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
for(int l=0;l<[pricejson[@"count"] intValue];l++)
|
|
for(int l=0;l<[pricejson[@"count"] intValue];l++)
|
|
|
{
|
|
{
|
|
|
NSDictionary* price_item = pricejson[[NSString stringWithFormat:@"item_%d",l]];
|
|
NSDictionary* price_item = pricejson[[NSString stringWithFormat:@"item_%d",l]];
|
|
|
- [detail0_section setObject:[self model_kvItem:price_item.allKeys[0] value:price_item.allValues[0]] forKey:[NSString stringWithFormat:@"item_%d",detail0_item_count++]];
|
|
|
|
|
|
|
+ [detail0_section setObject:[self model_priceKvItem:price_item.allKeys[0] value:price_item.allValues[0]] forKey:[NSString stringWithFormat:@"item_%d",detail0_item_count++]];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -4969,6 +4975,15 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
++(NSDictionary*) model_priceKvItem:(NSString*) key value:(NSString*)value
|
|
|
|
|
+{
|
|
|
|
|
+ NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
|
|
|
|
|
+
|
|
|
|
|
+ [ret setValue:key forKey:@"key"];
|
|
|
|
|
+ [ret setValue:value forKey:@"val"];
|
|
|
|
|
+ [ret setValue:@"price" forKey:@"type"];
|
|
|
|
|
+ return ret;
|
|
|
}
|
|
}
|
|
|
+(NSDictionary*) model_kvItem:(NSString*) key value:(NSString*)value
|
|
+(NSDictionary*) model_kvItem:(NSString*) key value:(NSString*)value
|
|
|
{
|
|
{
|