From ccc6cac4df4a0e8a3fd740b669c2f9953516089f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Tue, 27 Jun 2023 16:24:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(topup):=E4=BF=AE=E6=AD=A3=E5=95=86=E6=88=B7?= =?UTF-8?q?=E5=85=85=E5=80=BC=E9=83=A8=E5=88=86=E7=9A=84=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?SQL=E8=AF=AD=E5=8F=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repository/top_up.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repository/top_up.go b/repository/top_up.go index 1047c11..9597936 100644 --- a/repository/top_up.go +++ b/repository/top_up.go @@ -35,13 +35,13 @@ func (tur _TopUpRepository) ListTopUps(pid string, startDate, endDate *types.Dat topUpQuery := tur.ds. From(goqu.T("tenement_top_ups").As("t")). LeftJoin(goqu.T("tenement").As("te"), goqu.On(goqu.I("te.id").Eq(goqu.I("t.tenement_id")), goqu.I("te.park_id").Eq(goqu.I("t.park_id")))). - LeftJoin(goqu.T("meter").As("m"), goqu.On(goqu.I("m.code").Eq(goqu.I("t.meter_id")), goqu.I("m.park_id").Eq(goqu.I("t.park_id")))). + LeftJoin(goqu.T("meter_04kv").As("m"), goqu.On(goqu.I("m.code").Eq(goqu.I("t.meter_id")), goqu.I("m.park_id").Eq(goqu.I("t.park_id")))). Select("t.*", goqu.I("te.full_name").As("tenement_name"), goqu.I("m.address").As("meter_address")). Where(goqu.I("t.park_id").Eq(pid)) countQuery := tur.ds. From(goqu.T("tenement_top_ups").As("t")). LeftJoin(goqu.T("tenement").As("te"), goqu.On(goqu.I("te.id").Eq(goqu.I("t.tenement_id")), goqu.I("te.park_id").Eq(goqu.I("t.park_id")))). - LeftJoin(goqu.T("meter").As("m"), goqu.On(goqu.I("m.code").Eq(goqu.I("t.meter_id")), goqu.I("m.park_id").Eq(goqu.I("t.park_id")))). + LeftJoin(goqu.T("meter_04kv").As("m"), goqu.On(goqu.I("m.code").Eq(goqu.I("t.meter_id")), goqu.I("m.park_id").Eq(goqu.I("t.park_id")))). Select(goqu.COUNT("t.*")). Where(goqu.I("t.park_id").Eq(pid))