forked from free-lancers/electricity_bill_calc_service
fix(tenement):修正商户查询结果的扫描以及错误返回null的问题。
This commit is contained in:
@@ -70,10 +70,12 @@ func (tr _TenementRepository) ListTenements(pid string, page uint, keyword, buil
|
||||
tenementQuery := tr.ds.
|
||||
From(goqu.T("tenement").As("t")).
|
||||
LeftJoin(goqu.T("park_building").As("b"), goqu.On(goqu.I("b.id").Eq(goqu.I("t.building")))).
|
||||
Select("t.*", goqu.I("b.name").As("building_name"))
|
||||
Select("t.*", goqu.I("b.name").As("building_name")).
|
||||
Where(goqu.I("t.park_id").Eq(pid))
|
||||
countQuery := tr.ds.
|
||||
From(goqu.T("tenement").As("t")).
|
||||
Select(goqu.COUNT("t.*"))
|
||||
Select(goqu.COUNT("t.*")).
|
||||
Where(goqu.I("t.park_id").Eq(pid))
|
||||
|
||||
if keyword != nil && len(*keyword) > 0 {
|
||||
pattern := fmt.Sprintf("%%%s%%", *keyword)
|
||||
|
Reference in New Issue
Block a user