feat:兼容Sqlite3,去除Find_in_set函数,将数据拆分读取
This commit is contained in:
@ -1,11 +1,32 @@
|
||||
package model
|
||||
|
||||
import "ArmedPolice/app/common/model"
|
||||
import (
|
||||
"ArmedPolice/app/common/model"
|
||||
"ArmedPolice/config"
|
||||
"ArmedPolice/utils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type SysBreakdown struct {
|
||||
*model.SysBreakdown
|
||||
}
|
||||
|
||||
// BreakdownTitle 故障信息
|
||||
func (m *SysBreakdown) BreakdownTitle(breakdown string) string {
|
||||
src := strings.Split(breakdown, ",")
|
||||
out := make([]string, 0)
|
||||
|
||||
for _, v := range src {
|
||||
data, has := config.SystemBreakdown[utils.StringToUnit64(v)]
|
||||
|
||||
if !has {
|
||||
continue
|
||||
}
|
||||
out = append(out, data)
|
||||
}
|
||||
return strings.Join(out, ",")
|
||||
}
|
||||
|
||||
func NewSysBreakdown() *SysBreakdown {
|
||||
return &SysBreakdown{}
|
||||
}
|
||||
|
Reference in New Issue
Block a user