|
@@ -196,8 +196,10 @@ func GetReportListV1(condition string, pars []interface{}, startSize, pageSize i
|
|
|
}
|
|
|
// 排序:1:未发布;2:已发布;3-待提交;4-待审批;5-已驳回;6-已通过
|
|
|
sql += `ORDER BY FIELD(state,3,1,4,5,6,2), modify_time DESC LIMIT ?,?`
|
|
|
- //_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
|
|
|
- err = global.DmSQL["rddp"].Raw(sql, pars, startSize, pageSize).Find(&items).Error
|
|
|
+ //_, err = o.Raw(sql, pars...).QueryRows(&items)
|
|
|
+ pars = append(pars, startSize)
|
|
|
+ pars = append(pars, pageSize)
|
|
|
+ err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&items).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -263,8 +265,10 @@ func GetReportListByGrant(condition string, pars []interface{}, startSize, pageS
|
|
|
}
|
|
|
// 排序:1:未发布;2:已发布;3-待提交;4-待审批;5-已驳回;6-已通过
|
|
|
sql += ` GROUP BY a.id ORDER BY FIELD(state,3,1,4,5,6,2), a.modify_time DESC LIMIT ?,?`
|
|
|
- //_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
|
|
|
- err = global.DmSQL["rddp"].Raw(sql, pars, startSize, pageSize).Find(&items).Error
|
|
|
+ //_, err = o.Raw(sql, pars...).QueryRows(&items)
|
|
|
+ pars = append(pars, startSize)
|
|
|
+ pars = append(pars, pageSize)
|
|
|
+ err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&items).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -291,8 +295,10 @@ func GetReportList(condition string, pars []interface{}, startSize, pageSize int
|
|
|
}
|
|
|
// 排序:1:未发布;2:已发布;3-待提交;4-待审批;5-已驳回;6-已通过
|
|
|
sql += `ORDER BY FIELD(state,3,1,4,5,6,2), modify_time DESC LIMIT ?,?`
|
|
|
- //_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
|
|
|
- err = global.DmSQL["rddp"].Raw(sql, pars, startSize, pageSize).Find(&items).Error
|
|
|
+ //_, err = o.Raw(sql, pars...).QueryRows(&items)
|
|
|
+ pars = append(pars, startSize)
|
|
|
+ pars = append(pars, pageSize)
|
|
|
+ err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&items).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1059,8 +1065,10 @@ WHERE
|
|
|
sql += condition
|
|
|
}
|
|
|
sql += ` ORDER BY publish_time DESC , title ASC LIMIT ?,?`
|
|
|
- //_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&list)
|
|
|
- err = global.DmSQL["rddp"].Raw(sql, pars, startSize, pageSize).Find(&list).Error
|
|
|
+ //_, err = o.Raw(sql, pars...).QueryRows(&list)
|
|
|
+ pars = append(pars, startSize)
|
|
|
+ pars = append(pars, pageSize)
|
|
|
+ err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&list).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1092,8 +1100,10 @@ WHERE
|
|
|
sql += orderBy
|
|
|
}
|
|
|
sql += ` LIMIT ?,? `
|
|
|
- //_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&list)
|
|
|
- err = global.DmSQL["rddp"].Raw(sql, pars, startSize, pageSize).Find(&list).Error
|
|
|
+ //_, err = o.Raw(sql, pars...).QueryRows(&list)
|
|
|
+ pars = append(pars, startSize)
|
|
|
+ pars = append(pars, pageSize)
|
|
|
+ err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&list).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1230,8 +1240,8 @@ func GetPageReportList(condition string, pars []interface{}, startSize, pageSize
|
|
|
return
|
|
|
}
|
|
|
sql += ` LIMIT ?,? `
|
|
|
- //_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
|
|
|
- err = global.DmSQL["rddp"].Raw(sql, pars, startSize, pageSize).Find(&items).Error
|
|
|
+ //_, err = o.Raw(sql, pars...).QueryRows(&items)
|
|
|
+ err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&items).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1412,8 +1422,8 @@ func GetReportByCondition(condition string, pars []interface{}, fieldArr []strin
|
|
|
sql += order
|
|
|
if isPage {
|
|
|
sql += ` LIMIT ?,?`
|
|
|
- //_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
|
|
|
- err = global.DmSQL["rddp"].Raw(sql, pars, startSize, pageSize).Find(&items).Error
|
|
|
+ //_, err = o.Raw(sql, pars...).QueryRows(&items)
|
|
|
+ err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&items).Error
|
|
|
} else {
|
|
|
//_, err = o.Raw(sql, pars).QueryRows(&items)
|
|
|
err = global.DmSQL["rddp"].Raw(sql, pars).Find(&items).Error
|