Commit 92a8870a authored by lujunye's avatar lujunye

修复刚好1个月时间显示

parent c1961cd9
...@@ -478,10 +478,17 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource, ...@@ -478,10 +478,17 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
cell.baozhiQ.text = "保质期:" + "\(data.shelf_life!)天" cell.baozhiQ.text = "保质期:" + "\(data.shelf_life!)天"
let month = data.shelf_life!/30 let month = data.shelf_life!/30
let day = data.shelf_life! % 30 let day = data.shelf_life! % 30
if month > 0 { if month > 0 {
if day != 0 {
cell.baozhiQ.text = "保质期:" + "\(month)月" + "\(day)天" cell.baozhiQ.text = "保质期:" + "\(month)月" + "\(day)天"
}else{
cell.baozhiQ.text = "保质期:" + "\(month)月"
}
} }
cell.baogao.text = "报告:无" cell.baogao.text = "报告:无"
if data.report_sn != nil { if data.report_sn != nil {
cell.baogao.text = "报告:" + "\(data.report_sn!)" cell.baogao.text = "报告:" + "\(data.report_sn!)"
...@@ -500,7 +507,12 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource, ...@@ -500,7 +507,12 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
let month = model.shelf_life!/30 let month = model.shelf_life!/30
let day = model.shelf_life! % 30 let day = model.shelf_life! % 30
if month > 0 { if month > 0 {
if day != 0 {
cell.baozhiQ.text = "保质期:" + "\(month)月" + "\(day)天" cell.baozhiQ.text = "保质期:" + "\(month)月" + "\(day)天"
}else{
cell.baozhiQ.text = "保质期:" + "\(month)月"
}
} }
cell.baogao.text = "报告:无" cell.baogao.text = "报告:无"
...@@ -532,7 +544,12 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource, ...@@ -532,7 +544,12 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
let month = model.shelf_life!/30 let month = model.shelf_life!/30
let day = model.shelf_life!%30 let day = model.shelf_life!%30
if month > 0 { if month > 0 {
cell.rkzj.text = "保质期:" + "\(month)月" + "\(day)天" if day != 0 {
cell.baozhiQ.text = "保质期:" + "\(month)月" + "\(day)天"
}else{
cell.baozhiQ.text = "保质期:" + "\(month)月"
}
} }
cell.baozhiQ.text = "报告:无" cell.baozhiQ.text = "报告:无"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment