|
@@ -802,7 +802,7 @@ func GetEdbDataListAllV1(condition string, pars []interface{}, source, subSource
|
|
|
}
|
|
|
|
|
|
// GetEdbDataListAllV1ByTo 通过事务链接获取数据列表
|
|
|
-func GetEdbDataListAllV1ByTo(to *gorm.DB, condition string, pars []interface{}, source, subSource, order int) (item []*EdbInfoSearchDataV1, err error) {
|
|
|
+func GetEdbDataListAllV1ByTo(to *gorm.DB, condition string, pars []interface{}, source, subSource, order int) (items []*EdbInfoSearchDataV1, err error) {
|
|
|
sql := ``
|
|
|
tableName := GetEdbDataTableName(source, subSource)
|
|
|
sql = ` SELECT * FROM %s WHERE 1=1 `
|
|
@@ -816,7 +816,16 @@ func GetEdbDataListAllV1ByTo(to *gorm.DB, condition string, pars []interface{},
|
|
|
} else {
|
|
|
sql += ` ORDER BY data_time DESC `
|
|
|
}
|
|
|
- err = to.Raw(sql, pars...).Scan(&item).Error
|
|
|
+ err = to.Raw(sql, pars...).Scan(&items).Error
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 日期格式化
|
|
|
+ for _, item := range items {
|
|
|
+ item.ConvertDate()
|
|
|
+ }
|
|
|
+
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1811,3 +1820,12 @@ func (m SortEdbDataList) Less(i, j int) bool {
|
|
|
func (m SortEdbDataList) Swap(i, j int) {
|
|
|
m[i], m[j] = m[j], m[i]
|
|
|
}
|
|
|
+
|
|
|
+// ConvertDate
|
|
|
+// @Description: 格式化EdbData的日期
|
|
|
+// @receiver e
|
|
|
+func (m *EdbInfoSearchDataV1) ConvertDate() {
|
|
|
+ m.DataTime = utils.GormDateStrToDateStr(m.DataTime)
|
|
|
+
|
|
|
+ return
|
|
|
+}
|