forked from free-lancers/electricity_bill_calc_service
		
	fix(meter):修正未绑定表计的查询。
This commit is contained in:
		| @@ -300,13 +300,13 @@ func listUnboundMeters(c *fiber.Ctx) error { | ||||
| 		meterLog.Error("无法列出指定园区中尚未绑定公摊表计的表计,无法获取当前用户会话", zap.Error(err)) | ||||
| 		return result.Unauthorized(err.Error()) | ||||
| 	} | ||||
| 	parkId := c.Params("pid") | ||||
| 	if pass, err := checkParkBelongs(parkId, meterLog, c, &result); !pass { | ||||
| 	parkId := tools.EmptyToNil(c.Query("park")) | ||||
| 	if pass, err := checkParkBelongs(*parkId, meterLog, c, &result); !pass { | ||||
| 		return err | ||||
| 	} | ||||
| 	keyword := c.Query("keyword") | ||||
| 	limit := uint(c.QueryInt("limit", 6)) | ||||
| 	meters, err := repository.MeterRepository.ListUnboundMeters(session.Uid, &parkId, &keyword, &limit) | ||||
| 	meters, err := repository.MeterRepository.ListUnboundMeters(session.Uid, parkId, &keyword, &limit) | ||||
| 	if err != nil { | ||||
| 		meterLog.Error("无法列出指定园区中尚未绑定公摊表计的表计,无法获取表计列表", zap.Error(err)) | ||||
| 		return result.Error(http.StatusInternalServerError, err.Error()) | ||||
|   | ||||
| @@ -44,7 +44,7 @@ type MeterReplacingForm struct { | ||||
| type SimplifiedMeterQueryResponse struct { | ||||
| 	Code    string  `json:"code"` | ||||
| 	Address *string `json:"address"` | ||||
| 	Park    string  `json:"parkId"` | ||||
| 	Park    string  `json:"park"` | ||||
| } | ||||
|  | ||||
| type SimplifiedMeterDetailResponse struct { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user