From ad1b816795cb19d1fe23f182676b3a6419c30d29 Mon Sep 17 00:00:00 2001 From: DEKA_123 <1904876928@qq.com> Date: Tue, 8 Aug 2023 13:47:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(#5):=E4=BF=AE=E5=A4=8D=E6=8A=84=E8=A1=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E8=A1=A8=E8=AE=A1=E4=BF=A1=E6=81=AF=E5=A4=9A=E4=BD=99=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E4=B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- global/redis.go | 4 ++-- repository/meter.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/global/redis.go b/global/redis.go index db8577b..ebf038b 100644 --- a/global/redis.go +++ b/global/redis.go @@ -18,8 +18,8 @@ func SetupRedisConnection() error { a := fmt.Sprintf("%s:%d", config.RedisSettings.Host, config.RedisSettings.Port) fmt.Println(a) Rd, err = rueidis.NewClient(rueidis.ClientOption{ - InitAddress: []string{"127.0.0.1:6379"}, - Password: "", + InitAddress: []string{"192.168.88.129:6379"}, + Password: "123456", SelectDB: config.RedisSettings.DB, DisableCache: true, }) diff --git a/repository/meter.go b/repository/meter.go index 0a095d1..191427d 100644 --- a/repository/meter.go +++ b/repository/meter.go @@ -784,14 +784,14 @@ func (mr _MeterRepository) ListMeterReadings(pid string, keyword *string, page u readingQuery := mr.ds. From(goqu.T("meter_reading").As("r")). - LeftJoin(goqu.T("meter_04kv").As("m"), goqu.On(goqu.I("r.meter_id").Eq(goqu.I("m.code")))). + LeftJoin(goqu.T("meter_04kv").As("m"), goqu.On(goqu.I("r.meter_id").Eq(goqu.I("m.code")), goqu.I("m.park_id").Eq(goqu.I("r.park_id")))). Select("r.*"). Where( goqu.I("r.park_id").Eq(pid), ) countQuery := mr.ds. From(goqu.T("meter_reading").As("r")). - LeftJoin(goqu.T("meter_04kv").As("m"), goqu.On(goqu.I("r.meter_id").Eq(goqu.I("m.code")))). + LeftJoin(goqu.T("meter_04kv").As("m"), goqu.On(goqu.I("r.meter_id").Eq(goqu.I("m.code")), goqu.I("m.park_id").Eq(goqu.I("r.park_id")))). Select(goqu.COUNT("*")). Where( goqu.I("r.park_id").Eq(pid),