From 6dec2342316aecf4084c8f4efb43f33fbb72892f Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期二, 09 四月 2024 14:07:43 +0800
Subject: [PATCH] 更新计量单位字典
---
models/location.go | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/models/location.go b/models/location.go
index be55274..bcae4ac 100644
--- a/models/location.go
+++ b/models/location.go
@@ -27,6 +27,8 @@
NextCount string `json:"nextCount" gorm:"type:varchar(255);comment:涓嬫鐩樼偣"` //涓嬫鐩樼偣
JointName string `json:"jointName" gorm:"type:varchar(255);comment:鎷兼帴鍚嶇О"` //鎷兼帴鍚嶇О
Children []*Location `json:"children" gorm:"-"`
+ WarehouseId int `json:"warehouseId" gorm:"type:int;not null;default:0;comment:浠撳簱ID"` //浠撳簱ID
+ Warehouse Warehouse `json:"warehouse" gorm:"foreignKey:WarehouseId"` //浠撳簱
}
LocationSearch struct {
@@ -164,6 +166,10 @@
db = db.Where("is_scrap_location = ?", slf.IsScrapLocation)
}
+ if slf.Preload {
+ db = db.Preload("Warehouse")
+ }
+
return db
}
--
Gitblit v1.8.0