fix: offline state version

This commit is contained in:
2023-12-27 10:37:08 +08:00
parent 491456caa0
commit c708ea4215
3 changed files with 21 additions and 9 deletions

View File

@@ -1821,13 +1821,14 @@ func XormGetTraceRawMsg(id int) (int64, []byte, error) {
return timestamp, rawMsg, nil
}
func XormGetNESN(neType, neID string) (string, error) {
func XormGetNEStateInfo(neType, neID string) (string, string, error) {
SN := "-"
Version := "-"
_, err := xEngine.Table("ne_state").
Where("ne_type=? and ne_id=?", neType, neID).
Asc("timestamp").
Cols("serial_num").
Desc("timestamp").
Cols("serial_num", "version").
Limit(1).
Get(&SN)
return SN, err
Get(&SN, &Version)
return SN, Version, err
}