Blame view
App/model/CongTruong.swift
1.22 KB
d774f0637
|
1 |
import Foundation |
defd9642e
|
2 |
import GeneralUtils |
d774f0637
|
3 |
|
defd9642e
|
4 5 6 7 8 |
class CongTruong: Mappable { var id: Int? var companyName: String? var constructionName: String? var noCaptured: Int?, noRemain: Int? |
1341bf603
|
9 |
var shootItems: [ShootItem]? |
defd9642e
|
10 |
var signboard: Int? |
1341bf603
|
11 |
|
fbd62afcf
|
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
func getShootItemsName(isWillshoot: Bool) -> String? { guard let shootItems = shootItems else { return nil } var result = ""; for item in shootItems { if (isWillshoot && item.willShoot != nil && item.willShoot! > 0) || !isWillshoot { if let name = item.name { if result.length > 0 { result = result + ", " } result = result + name; } if result.length > 100 { return result; } } } return result; } |
defd9642e
|
28 29 30 |
// region: ========== Mappable init() {} required init?(map: Map) {} |
1341bf603
|
31 |
|
defd9642e
|
32 |
func mapping(map: Map) { |
fbd62afcf
|
33 |
id <- map["id"] |
defd9642e
|
34 35 36 37 38 |
companyName <- map["companyName"] constructionName <- map["constructionName"] noCaptured <- map["noCaptured"] noRemain <- map["noRemain"] shootItems <- map["shootingItems"] |
fbd62afcf
|
39 |
signboard <- map["signBoard"] |
defd9642e
|
40 41 |
} //endregion |
d774f0637
|
42 |
} |