From 318c49da20ec30c4f85ef35e479499e82a841b25 Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期一, 11 三月 2024 14:18:13 +0800 Subject: [PATCH] swag提交 --- models/material.go | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/models/material.go b/models/material.go index a73db2c..721368f 100644 --- a/models/material.go +++ b/models/material.go @@ -59,7 +59,7 @@ ControlStrategy constvar.InvoicingStrategy `gorm:"type:int(11);comment:鎺у埗绛栫暐" json:"controlStrategy"` //鎺у埗绛栫暐 BuyExplain string `gorm:"type:varchar(512);comment:閲囪喘璇存槑" json:"buyExplain"` //閲囪喘璇存槑 Principal string `gorm:"type:varchar(255);comment:璐熻矗浜�" json:"principal"` //璐熻矗浜� - Weight decimal.Decimal `gorm:"type:decimal(20,2);comment:閲嶉噺" json:"weight"` //閲嶉噺 + Weight decimal.Decimal `gorm:"type:decimal(20,3);comment:閲嶉噺" json:"weight"` //閲嶉噺 Volume decimal.Decimal `gorm:"type:decimal(20,2);comment:浣撶Н" json:"volume"` //浣撶Н MakeAdvanceTime decimal.Decimal `gorm:"type:decimal(20,2);comment:鍒堕�犲墠缃椂闂�" json:"makeAdvanceTime"` //鍒堕�犲墠缃椂闂�(澶�) OrderAdvanceTime decimal.Decimal `gorm:"type:decimal(20,2);comment:璁㈠崟鍑嗗澶╂暟" json:"orderAdvanceTime"` //璁㈠崟鍑嗗澶╂暟(澶�) @@ -110,7 +110,7 @@ } func NewMaterialSearch() *MaterialSearch { - return &MaterialSearch{Orm: mysqlx.GetDB().Where("is_storage = ", 1)} //鍙煡璇㈡湁搴撳瓨鐨� + return &MaterialSearch{Orm: mysqlx.GetDB().Where("is_storage = ?", 1)} //鍙煡璇㈡湁搴撳瓨鐨� } func (slf *MaterialSearch) SetOrm(tx *gorm.DB) *MaterialSearch { @@ -133,10 +133,10 @@ return slf } -//func (slf *MaterialSearch) SetIsSale(isSale bool) *MaterialSearch { -// slf.IsSale = isSale -// return slf -//} +func (slf *MaterialSearch) SetIsSale(isSale bool) *MaterialSearch { + slf.IsSale = isSale + return slf +} func (slf *MaterialSearch) SetIDs(ids []string) *MaterialSearch { slf.Ids = ids @@ -249,9 +249,9 @@ if len(slf.Ids) > 0 { db = db.Where("id in ?", slf.Ids) } - //if slf.IsSale { - // db = db.Where("is_sale = ?", 1) - //} + if slf.IsSale { + db = db.Where("is_sale = ?", 1) + } if slf.CategoryId > 0 { db = db.Where("category_id = ?", slf.CategoryId) } -- Gitblit v1.8.0