|
@@ -858,7 +858,7 @@ class KMMemberCenterManager: NSObject {
|
|
|
for dict1 in result_Array {
|
|
|
var id = ""
|
|
|
var productName = ""
|
|
|
- var price = ""
|
|
|
+ var price = NSNumber(value: 0.0)
|
|
|
var maxDeviceNum = 0
|
|
|
var levels = ""
|
|
|
var platforms = ""
|
|
@@ -866,18 +866,20 @@ class KMMemberCenterManager: NSObject {
|
|
|
var paymentModel = 0
|
|
|
var cycle = 0
|
|
|
var code = ""
|
|
|
- var cnyPrice = ""
|
|
|
- if let token = dict1["id"] as? String { id = token }
|
|
|
- if let token = dict1["productName"] as? String { productName = token }
|
|
|
- if let token = dict1["price"] as? Double { price = String(format: "%.2f", token) }
|
|
|
- if let token = dict1["maxDeviceNum"] as? Int { maxDeviceNum = token }
|
|
|
- if let token = dict1["levels"] as? String { levels = token }
|
|
|
- if let token = dict1["platforms"] as? String { platforms = token }
|
|
|
- if let token = dict1["productLineId"] as? Int { productLineId = token }
|
|
|
- if let token = dict1["paymentModel"] as? Int { paymentModel = token }
|
|
|
- if let token = dict1["cycle"] as? Int { cycle = token }
|
|
|
- if let token = dict1["code"] as? String { code = token }
|
|
|
- if let token = dict1["cnyPrice"] as? String { cnyPrice = token }
|
|
|
+ var cnyPrice = NSNumber(value: 0.0)
|
|
|
+
|
|
|
+ if let token = dict1["id"] { id = token as? String ?? id }
|
|
|
+ if let token = dict1["productName"] { productName = token as? String ?? productName }
|
|
|
+ if let token = dict1["price"] { price = token as? NSNumber ?? price }
|
|
|
+ if let token = dict1["maxDeviceNum"] { maxDeviceNum = token as? Int ?? maxDeviceNum }
|
|
|
+ if let token = dict1["levels"] { levels = token as? String ?? levels }
|
|
|
+ if let token = dict1["platforms"] { platforms = token as? String ?? platforms }
|
|
|
+ if let token = dict1["productLineId"] { productLineId = token as? Int ?? productLineId }
|
|
|
+ if let token = dict1["paymentModel"] { paymentModel = token as? Int ?? paymentModel }
|
|
|
+ if let token = dict1["cycle"] { cycle = token as? Int ?? cycle }
|
|
|
+ if let token = dict1["code"] { code = token as? String ?? code }
|
|
|
+ if let token = dict1["cnyPrice"] { cnyPrice = token as? NSNumber ?? cnyPrice }
|
|
|
+
|
|
|
let products = KMListingProductsModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, code: code, cnyPrice: cnyPrice)
|
|
|
results.append(products)
|
|
|
}
|
|
@@ -926,7 +928,7 @@ class KMMemberCenterManager: NSObject {
|
|
|
for dict1 in result_Array {
|
|
|
var id = ""
|
|
|
var productName = ""
|
|
|
- var price = ""
|
|
|
+ var price = NSNumber(value: 0.0)
|
|
|
var maxDeviceNum = 0
|
|
|
var levels = ""
|
|
|
var platforms = ""
|
|
@@ -934,10 +936,10 @@ class KMMemberCenterManager: NSObject {
|
|
|
var paymentModel = 0
|
|
|
var cycle = 0
|
|
|
var code = ""
|
|
|
- var cnyPrice = ""
|
|
|
+ var cnyPrice = NSNumber(value: 0.0)
|
|
|
if let token = dict1["id"] { id = token as! String }
|
|
|
if let token = dict1["productName"] { productName = token as! String }
|
|
|
- if let token = dict1["price"] { price = token as! String }
|
|
|
+ if let token = dict1["price"] { price = token as! NSNumber }
|
|
|
if let token = dict1["maxDeviceNum"] { maxDeviceNum = token as! Int }
|
|
|
if let token = dict1["levels"] { levels = token as! String }
|
|
|
if let token = dict1["platforms"] { platforms = token as! String }
|
|
@@ -945,7 +947,7 @@ class KMMemberCenterManager: NSObject {
|
|
|
if let token = dict1["paymentModel"] { paymentModel = token as! Int }
|
|
|
if let token = dict1["cycle"] { cycle = token as! Int }
|
|
|
if let token = dict1["code"] { code = token as! String }
|
|
|
- if let token = dict1["cnyPrice"] { cnyPrice = token as! String }
|
|
|
+ if let token = dict1["cnyPrice"] { cnyPrice = token as! NSNumber }
|
|
|
let products = KMListingProductsModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, code: code, cnyPrice: cnyPrice)
|
|
|
results.append(products)
|
|
|
}
|