From 884bce48b11018adf1c15591aeab9af6cb9e5b6b Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 12 一月 2024 10:53:25 +0800
Subject: [PATCH] 支持有库存管理的产品
---
service/test/product.go | 2 +-
model/test/material.go | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/model/test/material.go b/model/test/material.go
index 58f6412..257a277 100644
--- a/model/test/material.go
+++ b/model/test/material.go
@@ -26,7 +26,9 @@
MinPurchaseAmount decimal.Decimal `gorm:"type:decimal(35,18);comment:鏈�灏忛噰璐噺" json:"minPurchaseAmount"`
PurchaseType PurchaseType `gorm:"type:int(11);comment:閲囪喘绫诲瀷" json:"purchaseType"`
SalePrice decimal.Decimal `gorm:"type:decimal(35,18);comment:閿�鍞崟浠�" json:"salePrice"`
- CategoryName string `gorm:"type:varchar(255);comment:浜у搧绫诲埆鍚嶇О" json:"categoryName"` //浜у搧绫诲埆鍚嶇О
+ CategoryName string `gorm:"type:varchar(255);comment:浜у搧绫诲埆鍚嶇О" json:"categoryName"` //浜у搧绫诲埆鍚嶇О
+ IsStorage int `gorm:"type:tinyint(1);default:1;comment:鏄惁瀛樺簱(1鏄�2鍚�)" json:"isStorage"` //鏃犲簱瀛樼殑鍦╳ms浠ュ強srm涓渶瑕佽繃婊ゆ帀
+ IsVirtual int `json:"isVirtual" gorm:"type:tinyint(1);default:2;comment:鏄惁铏氭嫙鐗╂枡(1鏄�2鍚�)"` //铏氭嫙鐗╂枡鍦∕RP璁$畻鏃惰烦杩囪灞傜骇鐩存帴棰嗙敤涓嬬骇鐗╂枡锛岃櫄鎷熺墿鏂欎笉鐢熸垚宸ュ崟
}
// PurchaseType 閲囪喘绫诲瀷
diff --git a/service/test/product.go b/service/test/product.go
index 1b71fec..6375fca 100644
--- a/service/test/product.go
+++ b/service/test/product.go
@@ -120,7 +120,7 @@
db = db.Where("purchase_type = ?", test.PurchaseTypeOutSource)
- db = db.Where("material_type != ?", test.MaterialTypeVirtual)
+ db = db.Where("is_storage = ?", 1)
err = db.Count(&total).Error
if err != nil {
--
Gitblit v1.8.0