fix:#6 解决表号为空时候的sql错误
This commit is contained in:
parent
2bab62512a
commit
a3d4dbfca5
|
@ -18,8 +18,8 @@ func SetupRedisConnection() error {
|
||||||
a := fmt.Sprintf("%s:%d", config.RedisSettings.Host, config.RedisSettings.Port)
|
a := fmt.Sprintf("%s:%d", config.RedisSettings.Host, config.RedisSettings.Port)
|
||||||
fmt.Println(a)
|
fmt.Println(a)
|
||||||
Rd, err = rueidis.NewClient(rueidis.ClientOption{
|
Rd, err = rueidis.NewClient(rueidis.ClientOption{
|
||||||
InitAddress: []string{"192.168.88.129:6379"},
|
InitAddress: []string{"127.0.0.1:6379"},
|
||||||
Password: "123456",
|
Password: "",
|
||||||
SelectDB: config.RedisSettings.DB,
|
SelectDB: config.RedisSettings.DB,
|
||||||
DisableCache: true,
|
DisableCache: true,
|
||||||
})
|
})
|
||||||
|
|
|
@ -524,6 +524,9 @@ func (mr _MeterRepository) ListPooledMeterRelationsByCodes(pid string, codes []s
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
var relations []*model.MeterRelation
|
var relations []*model.MeterRelation
|
||||||
|
if len(codes) <= 0 {
|
||||||
|
return relations, nil
|
||||||
|
}
|
||||||
relationsSql, relationsArgs, _ := mr.ds.
|
relationsSql, relationsArgs, _ := mr.ds.
|
||||||
From(goqu.T("meter_relations").As("r")).
|
From(goqu.T("meter_relations").As("r")).
|
||||||
Select("r.*").
|
Select("r.*").
|
||||||
|
|
|
@ -12,9 +12,9 @@ Server:
|
||||||
ReadTimeout: 60
|
ReadTimeout: 60
|
||||||
WriteTimeout: 60
|
WriteTimeout: 60
|
||||||
Redis:
|
Redis:
|
||||||
Host: 192.168.88.129
|
Host: 127.0.0.1
|
||||||
Port: 6379
|
Port: 6379
|
||||||
Password: 123456
|
Password:
|
||||||
DB: 1
|
DB: 1
|
||||||
Service:
|
Service:
|
||||||
MaxSessionLife: 2h
|
MaxSessionLife: 2h
|
||||||
|
|
Loading…
Reference in New Issue
Block a user