fix(park):修正园区详细信息的查询。

This commit is contained in:
徐涛 2023-06-08 22:14:27 +08:00
parent c302b32367
commit ea1c1d7829
2 changed files with 12 additions and 6 deletions

View File

@ -11,15 +11,15 @@ type Park struct {
UserId string `json:"userId"`
Name string `json:"name"`
Area decimal.NullDecimal `json:"area"`
TenementQuantity decimal.NullDecimal `json:"tenementQuantity"`
TenementQuantity decimal.NullDecimal `json:"tenement"`
Capacity decimal.NullDecimal `json:"capacity"`
Category int16 `json:"category"`
MeterType int16 `json:"meter04kvType"`
MeterType int16 `json:"meter04kvType" db:"meter_04kv_type"`
PricePolicy int16 `json:"pricePolicy"`
BasicPooled int16 `json:"basicPooled"`
AdjustPooled int16 `json:"adjustPooled"`
LossPooled int16 `json:"lossPooled"`
PublicPooled int16 `json:"publicPooled"`
BasicPooled int16 `json:"basicDiluted"`
AdjustPooled int16 `json:"adjustDiluted"`
LossPooled int16 `json:"lossDiluted"`
PublicPooled int16 `json:"publicDiluted"`
TaxRate decimal.NullDecimal `json:"taxRate"`
Region *string `json:"region"`
Address *string `json:"address"`

View File

@ -141,6 +141,12 @@ func (pr _ParkRepository) RetrieveParkDetail(pid string) (*model.Park, error) {
var park model.Park
parkSql, parkArgs, _ := pr.ds.
From("park").
Select(
"id", "user_id", "name", "area", "tenement_quantity", "capacity", "category",
"meter_04kv_type", "region", "address", "contact", "phone", "enabled", "price_policy", "tax_rate",
"basic_pooled", "adjust_pooled", "loss_pooled", "public_pooled", "created_at", "last_modified_at",
"deleted_at",
).
Where(goqu.I("id").Eq(pid)).
Prepared(true).ToSQL()
if err := pgxscan.Get(ctx, global.DB, &park, parkSql, parkArgs...); err != nil {