|
@@ -171,7 +171,7 @@ func (m *ReportApprove) GetCountByCondition(condition string, pars []interface{}
|
|
//o := orm.NewOrmUsingDB("rddp")
|
|
//o := orm.NewOrmUsingDB("rddp")
|
|
sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
|
|
sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
|
|
//err = o.Raw(sql, pars).QueryRow(&count)
|
|
//err = o.Raw(sql, pars).QueryRow(&count)
|
|
- err = global.DmSQL["rddp"].Raw(sql, pars).Scan(&count).Error
|
|
|
|
|
|
+ err = global.DmSQL["rddp"].Raw(sql, pars...).Scan(&count).Error
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
@@ -187,7 +187,7 @@ func (m *ReportApprove) GetItemsByCondition(condition string, pars []interface{}
|
|
}
|
|
}
|
|
sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
|
|
sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
|
|
//_, err = o.Raw(sql, pars).QueryRows(&items)
|
|
//_, err = o.Raw(sql, pars).QueryRows(&items)
|
|
- err = global.DmSQL["rddp"].Raw(sql, pars).Find(&items).Error
|
|
|
|
|
|
+ err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&items).Error
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|