|
@@ -161,10 +161,11 @@ func (d *SafeDao) GetTypeYear(bidsectionId int, year int) []viewmodels.SafeSurve
|
|
|
endYear := fmt.Sprintf("%d-12-31:23.59.59", year)
|
|
|
|
|
|
datalist := make([]viewmodels.SafeSurveyList, 0)
|
|
|
- _ = d.engine.Table("`cm_safe` as cs").
|
|
|
- Select("cs.id, cs.`create_time`, cs.`inspection_detail`, cs.status, pa.`name` as `audit_name`").
|
|
|
- Where("cs.bidsection_id = ? and cs.create_time>='"+startYear+"' and cs.create_time<='"+endYear+"' ", bidsectionId).
|
|
|
- Join("left", "cm_project_account as pa", "pa.id = cs.uid").
|
|
|
+ _ = d.engine.Table("`cm_approver` as cs").
|
|
|
+ Select("cs.data_id as id, cs.`create_time`, s.`inspection_detail`, cs.status, pa.`name` as `audit_name`").
|
|
|
+ Where("cs.bidsection_id = ? and data_type=1 and cs.create_time>='"+startYear+"' and cs.create_time<='"+endYear+"' ", bidsectionId).
|
|
|
+ Join("left", "cm_safe as s", "s.id = cs.data_id").
|
|
|
+ Join("left", "cm_project_account as pa", "pa.id = cs.audit_id").
|
|
|
Desc("id").
|
|
|
Find(&datalist)
|
|
|
return datalist
|